This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Screen changing

 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,

When i change from one intent to another, i am unable to view first screen(i.e first intent)

I can view second screen but now first one.
What may be the reason.

Thanks
Chetan
 
Imran Mohd
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


if this is your code,, than you can't see the first Activity, because once the first Activity is Started. onCreate() method will be called, than it will call your second Activity immediately

 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then what may be the solution ,if i want to shift between one screen to another ?
 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if i change the screen first and then change the contentView
 
Imran Mohd
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
add a button to the layout, in that button's OnClickListener() write this code

Intent i = new Intent(this,activity2.class);
startActivity(i);


This May Help You..!!

 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am calling this one like following code :


And i am using this anim.xml in anim folder



But i am not able to change between the screens when i catch the particular activity request code.

i have tried so much but no success can you please help me.



 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets assume there are two Activities- FirstActivity and SecondActivity.

FirstActivity wants to invoke SecondActivity. SecondActivity will display something/do its processing and then when done, it will return the control back to FirstActivity.

This can be achieved by following ...
In FirstActivity, executing this code will call SecondActivity:


When the SecondActivity has done its processing and wishes to "return" it says:


The control then returns to FirstActivity, you will have to code(implement)
method accordingly.

I hope that helps.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic