This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
// we can call befor the defined | |
welcom(); | |
// once we defined the function we can call it where we want | |
function welcom(){ | |
console.log("hi"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function welcom(){ | |
console.log("hi"); | |
} | |
welcom(); | |
------------------------ | |
var welcom = function (){ | |
console.log("hi"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main (){ | |
System.Out.println("Hello World") ; | |
sout("Test"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks<Cursor> { | |
private static final int URL_LOADER = 0; | |
WordCursorAdapter mAdapter; | |
// Define a projection that specifies which columns from the database | |
// you will actually use after this query. | |
String[] projection = { | |
Words._ID, | |
Words.COLUMN_WORD, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
Cursor cursor; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
// Define a projection that specifies which columns from the database | |
// you will actually use after this query. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.. | |
@Override | |
public View newView(Context context, Cursor cursor, ViewGroup viewGroup) { | |
return LayoutInflater.from(context).inflate(R.layout.word_item_layout, viewGroup, false); | |
} | |
@Override | |
public void bindView(View view, Context context, Cursor cursor) { | |
TextView t_word = view.findViewById(R.id.item_word); | |
TextView t_word_A = view.findViewById(R.id.item_word_a); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WordCursorAdapter extends CursorAdapter{ | |
Context context; | |
Cursor cursor; | |
public WordCursorAdapter(Context x, Cursor c){ | |
super(x, c,0); | |
this.context = x; | |
this.cursor = c; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
android:padding="8dp"> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void insertData() { | |
ContentValues values = new ContentValues(); | |
values.put(Words.COLUMN_WORD, "Test Word"); | |
values.put(Words.COLUMN_WORD_T, "Test T Word"); | |
values.put(Words.COLUMN_WORD_T2, "Test T2 Word"); | |
values.put(Words.COLUMN_WORD_T3, "Test T3 Word"); | |
values.put(Words.COLUMN_ARTIKEL, Words.ARTIKEL_UNKNOWN); | |
Uri newURI = getContentResolver().insert(DeutchVContract.CONTENT_URI, values); | |
if (newURI != null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
@Nullable | |
@Override | |
public Uri insert(@NonNull Uri uri, @Nullable ContentValues contentValues) { | |
final int match = uriMatcher.match(uri); | |
switch (match){ | |
case WORDS_CODE : | |
return insertData(uri, contentValues); | |
default: |