1

i use 2 activities A and B where A is an activity with in a tabhost.

i call the activity B from A

code used for calling an activity

 mybund.putString("event", obj_rowitem.getevent());
Intent schedule = new Intent(getApplicationContext(), Schedule.class);
schedule.putExtras(mybund);
startActivityForResult(schedule, req_code);

the Activity B returns some data to the activity A

code in B

Bundle mybund = new Bundle();
mybund.putString("date",date);
Intent data = new Intent();
data.putExtras(mybund);
setResult(RESULT_OK, data);
Log.e("going",date);
finish();

i use OnActivity results on A.

but the code that written on onactivityresult block doesn't work

Nirav Ranpara
  • 13,753
  • 3
  • 39
  • 54
Vikky
  • 933
  • 2
  • 15
  • 29
  • see this http://stackoverflow.com/questions/2497205/how-to-return-a-result-startactivityforresult-from-a-tabhost-activity?rq=1 – ShreeshaDas Dec 06 '12 at 10:58

1 Answers1

0

If your Activity A is in the tab host then you have to use the startActivityForResult with the context of tabhost. below is example of the same

((YourTabGroup) className.this.getParent()).startActivityForResult(intent, code);
Dinesh Prajapati
  • 9,274
  • 5
  • 30
  • 47
  • would you pls give me more explanation..??? context of tabhost means, the context of activity which resides a tabhost?? – Vikky Dec 07 '12 at 03:07