Skip to content

Instantly share code, notes, and snippets.

@jezinka
Last active March 20, 2017 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jezinka/d65eb9dcd2beae5621b9bbcf01db0797 to your computer and use it in GitHub Desktop.
Save jezinka/d65eb9dcd2beae5621b9bbcf01db0797 to your computer and use it in GitHub Desktop.
public class MealListActivity extends AppCompatActivity {
private CoNaObiadDbHelper dbHelper;
private String mealName = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_meal_list);
final MealContract mealContract = new MealContract();
dbHelper = new CoNaObiadDbHelper(this);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mealContract.getAllMeals(dbHelper));
ListView listView = (ListView) findViewById(R.id.meal_list_view);
listView.setAdapter(adapter);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment