Question

I want to show the details of a list item in another activity when clicks on a button.Can you help me?

Was it helpful?

Solution

Though it would be better if you would mention some details... as far as i can guess u want to use some data from a previous activity to show in another activity.. The method to do this is putExtras in intent.. e.g.

Intent intent = new Intent(this, nxtActivityName.class);
intent.putExtra(name, value);
startActivity(intent);

In the target activity, u can retrieve the data in the onCreate() method by using getIntent().getStringExtra(name); and use it as desired..

And if you are using a list, its better you use a ListActivity and override the onListItemClick(ListView l, View v, int position, long id) for doing ur needful...

OTHER TIPS

Additional to this you have to add a onClickListener on your selected button

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top