开发者

Set content based on a decision from a previous activity

开发者 https://www.devze.com 2023-03-30 18:12 出处:网络
Basically I want to set a image based on a previous activity. There is just ListView of locations(first activity), and just show a picture of the location based on the selection(second activity).

Basically I want to set a image based on a previous activity. There is just ListView of locations(first activity), and just show a picture of the location based on the selection(second activity).

I know it will have to do something with Intents, but other than开发者_JAVA百科 starting a new activity.

Are there super simple example I could read, I tried to understand

Display image based on Gridview selection from previous activity

but I couldn't really get it.


Where you start the new activity, you can use the intent in the following way:

yourIntent.putExtra("Decision", theDecision);
startActivity(yourIntent);

And in the new activity:

int theDesicion = getIntent.getIntExtra("Desicion");
0

精彩评论

暂无评论...
验证码 换一张
取 消