Created
September 16, 2018 00:43
-
-
Save barmgeat/bf6846cafce2b74cc66e2c5071923274 to your computer and use it in GitHub Desktop.
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. | |
String[] projection = { | |
Words._ID, | |
Words.COLUMN_WORD, | |
Words.COLUMN_WORD_T, | |
Words.COLUMN_WORD_T2 | |
}; | |
cursor = getContentResolver().query(DeutchVContract.CONTENT_URI, | |
projection, | |
null, | |
null | |
); | |
ListView wordList = findViewById(R.id.wordsListView); | |
WordCursorAdapter adapter = new WordCursorAdapter(this, cursor); | |
wordList.setAdapter(adapter); | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment