开发者

how to start an activity from a custom component & pass data in between?

I have created a component for table row an开发者_StackOverflow社区d added in to another activity.it's working fine.That table row has a button and some textviews.Now i want to pass values and start another activity when i am pressing this button.


//from where you have send data

Intent intent = new Intent(this, YourClass.class);
Bundle bundle = new Bundle();
bundle.putString("yourKey","yourvalue");
intent.putExtras(bundle);
startActivityForResult(intent,Intent.FILL_IN_DATA);

// on receiving activity //onCreate(Bundle savedInstanceSatet);

Bundle bundle = getIntent().getExtras();
String a = bundle.getString("yourkey")

and as such populate your data

i hope this will help you.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜