[Solved] Drug dictionary android


When launching the detail activity you can receive information with the intent so that you are able to display the item accordingly.

from the list activity :

Intent intent = new Intent(getApplicationContext(), DetailActivity.class);
intent.putExtra("OBJ_ID", drugObj.id);
startActivity(intent);

from the detail activity in the onCreate method :

int drugID = getIntent().getIntExtra("OBJ_ID", 0);

Please note the above is an example based on a drug object that has its unique id an integer

After you get the ID from the intent you are good to go..loop through your drug objects and display data accordingly.

Hope it helps

1

solved Drug dictionary android