How to pass a value from a main activity to a sub activity using intent?
I used a listview clist and used clist.setOnItemClickListener(new AdapterView.OnItemClickListener() { Now i want to get the item which i clicked on a su开发者_JAVA技巧b activity which i called using an intent. How can i do this???? Thanks in advance for those help me....
clist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position,
long arg3)
{
String xy=clist.getItemAtPosition(position).toString();
temp=xy.split("-");
String xz=temp[0];
Intent intente=new Intent(Cardetails.this,EditPage.class);
intente.putExtra("key",xz);
startActivityForResult(intente, var2);
}
});
var2 is the request code.
精彩评论