So I am passing in a String array into my onPostExecute method, but I was wondering how I can access the output of this thread in the next activity… i.e. Page.class
Right now I am using a putExtra, is there anything else I can do? After the putExtra here, how can I access this in Page.class. Note that Page.class is NOT the class that starts this thread.
public void onPostExecute(String[] x){
d.dismiss();
Intent i= new Intent(ctx,Page.class);
i.putExtra("values", x);
ctx.startActivity(i);
Intent b = getIntent();
String[] values = b.getStringArrayExtra("values");
Log.d("hello", values[0]);
Your
Page.classis the activity started byonPostExecute(), right?Then whatever you put in the Extra Bundle would be accessible. @Gix already posted the way to access the bundle, so I am not repeating here. But please checkout the bundle class to see what you can put inside (Basically almost all primitives and arrays are OK)