Skip to content

Instantly share code, notes, and snippets.

@jezinka
Last active Mar 20, 2017
Embed
What would you like to do?
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