How to passing data between 3 activities (Android Studio) -


this question has answer here:

enter image description here

look @ image link above, how code simple passing data between 3 activities?

activity 1:

  • input name

  • then click insert button

  • then intent activity 2

activity 2:

  • click show button

  • then intent activity 3

activity 3:

  • settext input name activity 1

maybe should have use setter getter? how?

i need learning basic, :)

in activity 1:on click listener of insert button put this:

   intent  = new intent(activity1.this, activity2.class);    string name = input.gettext();    i.putextra("name",name);    startactivity(i); 

above code pass value activity 1 activity 2,i assume quite new android development go through link understand intents , starting activity

now in activity2 values intent

  string name=getintent().getstringextra("name"); 

name have value passed activity 1;

now following same pattern can pass value activity 2 activity 3


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -