Note that there are some explanatory texts on larger screens.

plurals
  1. POOnly last activity gets displayed
    primarykey
    data
    text
    <p>I have 3 activities which do some kind of network access and get a response with 3 corresponding xml layouts (I will call it A,B,C). A passes data to B through an Intent and B passes data to C through an Intent. When I execute the application, only the third activity/screen shows up on the emulator. </p> <p>How do I retain the sequence, like A gets displayed first, I hit a button then go to B then hit a button, then go to C. (Do I have to use the activity lifecycle as each activity gets a response after a network access.)</p> <p>The code (relevant parts) is :</p> <pre><code>A- username = (EditText) findViewById(R.id.editTextusername); password = (EditText) findViewById(R.id.editTextpassword); submit = (Button)findViewById(R.id.submit); //sampletext = (TextView) findViewById(R.id.textView1); submit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(username.getText().length()&gt;0 &amp;&amp; password.getText().length()&gt;0) { URLconnector ss = new URLconnector(); ss.execute("SOME URL"); //network access in an async task, get response, } Intent part of activity A - on post execute method of async task if(result != null) { Intent intentA = new Intent(mContext, B); Bundle bundle = new Bundle(); bundle.putString("responsedata",result.substring); tokenIntent.putExtras(bundle); startActivity(intentA); B- URLconnector ss = new URLconnector(); ss.execute("SOME URL"); //network access in an async task, get response, } Intent part of activity B - on post execute method of async task if(result != null) { Intent intentB = new Intent(mContext, c); startActivity(tokenIntent); c- URLconnector ss = new URLconnector(); ss.execute("SOME URL"); //network access in an async task, get response, } Intent part of activity c- on post execute method of async task if(result != null) { text3.setText(result); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload