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.
精彩评论