-2

I want to create new activity based on input user form MainActivity.

for example :

MainActivity input = 3

Then it will bring up alternating activity 3 times and each activity have EditText to input value form each new activity to be display to last activity. And last activity can displayed all input value form each new activity.

NewActivity1 input = 2

NewActivity2 input = 5

NewActivity3 input = 10

LastActivity will shown all input form each new activity : 2,5,10

can anyone help with this?

Divya Jain
  • 393
  • 1
  • 6
  • 22
  • This is very simple but how can you say that any Activity is last activity??? – Anil Jadhav Jul 10 '14 at 08:04
  • the last activity used for show all the input from all new activity.. so how to create the new activity as much as input form MainActivity? – Anggie Afianda Zarfan Jul 10 '14 at 08:21
  • 2,5,2,5,10,2 is this you required or not? MEans to open any activity from any other activity. – Anil Jadhav Jul 10 '14 at 08:25
  • is not like to open any activity from any other activity.. it most like i have 3 activity - MainActivity - NewActivity - LastActivity so, MainActivity will open NewActivity as much as input form MainActivity like example above is 3, then NewActivity will bring up NewActivity 3 times. The input from NewActivity above mean after NewActivity have new input it will do open itself to receive new input and then the input will shown in LastActivity. – Anggie Afianda Zarfan Jul 10 '14 at 08:34
  • You need to explain it clearly,,,by the way this is simple task only work with TextView and Intent to call another activity. You need to try it yourself. – Anil Jadhav Jul 10 '14 at 08:38

4 Answers4

0

use intent.putExtra to put the data inside the intent(2 first). Then grab that data and put it again in the a new intent(along with new data(2,5)) to call the next activity. Repeat this process

committedandroider
  • 8,711
  • 14
  • 71
  • 126
0

Create dynamic ViewPager with Fragment in each page instead of creating multiple activities dynamically.

intrepidkarthi
  • 3,104
  • 8
  • 42
  • 75
0

use

myIntent.putextra(name, value)

How to use putExtra() and getExtra() for string data

Community
  • 1
  • 1
wiz
  • 321
  • 2
  • 4
0

Start the new activity (which you want to open , say 3 times) and pass it through extras the number 2. The new activity then passes the number 1 to the next activity ( i.e. deprecating the count by 1 each time) and so on till the count reaches 0 when you pass to main activity. Or something like that. If you need more help come back.

Simon
  • 28
  • 2