Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Screen changing

 
Ranch Hand
Posts: 643
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 deol
Ranch Hand
Posts: 643
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then what may be the solution ,if i want to shift between one screen to another ?
 
chetan deol
Ranch Hand
Posts: 643
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 deol
Ranch Hand
Posts: 643
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.



 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Don't play dumb with me! But you can try this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic