开发者

lost in activities

开发者 https://www.devze.com 2023-02-26 02:48 出处:网络
I have an Activity that has some form elements. This can be called from other activities.. When the form activity loads, how do I know 开发者_JAVA技巧which one called it?

I have an Activity that has some form elements. This can be called from other activities.. When the form activity loads, how do I know 开发者_JAVA技巧which one called it?

Thanks in advance..


The easier way is to explicitly indicate that in the intent:

Intent i = new Intent(blnah);
i.putExtra("who", "Activity1");
startActivity(intent);

Then, on the other activity:

// this is the activity with the form
String who = getIntent().getStringExtra("who");
0

精彩评论

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