I have an application that opens another class using intent :
private void createRepository(){
Intent j = new Intent(this, Repository.class);
startActivityForResult(j, ACTIVITY_CREATE);
}
In Repository.class we have the onActivityResult method :
public void onActivityResult(int reqCode, int resultCode, Intent data) {
super.onActivityResult(reqCode, resultCode, data);
switch (reqCode) {
case (PICK_CONTACT) :
if (resultCode == Activity.RESULT_OK) {
Uri contactData = data.getData();
c = managedQuery(contactData, null, null, null, null);
if (c.moveToFirst()) {
//String name = c.getString(c.getColumnIndexOrThrow(People.NAME));
num = c.getString(c.getColumnIndexOrThrow(People.NUMBER));
}
}
break;
}
finish();
}
I don't know how I can return the value of num to the first class (that creates Repository.class). Thank you for your help. Michaël