I want to create an Intent from my Asynctask class to a tab. If I use the following code then instead of showing the data to the same tab a new activity is created and the data are displayed on that activity.
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
Intent in = new Intent(context, Details.class);
in.putExtra(TAG_FNAME, firstname);
in.putExtra(TAG_LNAME, lastname);
in.putExtra(TAG_GNDR, gender);
in.putExtra(TAG_DOB, date_of_birth);
context.startActivity(in);
}
In the above code i am sending the data from my Asynctask class to my Details.class
the Detail class contains 2 tabs: home and profile
how can i send the data to my profile.class which is a tab in Details.class
In the same way
Detailsclass will handle the other parameters, then you should handle an additional data in the extra of the bundle.I guess you use either
onCreateoronNewIntent(better) to handle those parameters inDetailsclass. From there, create your tab fragment using your static factory method (look here for thenewFragmentmethod), then use your tab manager to display the fragment.Btw,
Detailsis poorly name,DetailActivitywould be better.