*
The moose likes Android and the fly likes Screen changing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Screen changing" Watch "Screen changing" New topic
Author

Screen changing

chetan dhumane
Ranch Hand

Joined: Jan 07, 2009
Posts: 629

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

http://www.androcid.com/
Imran Mohd
Ranch Hand

Joined: Mar 02, 2009
Posts: 38


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



Cheers,
Mohd Imran (SCJP 1.5)
chetan dhumane
Ranch Hand

Joined: Jan 07, 2009
Posts: 629

Then what may be the solution ,if i want to shift between one screen to another ?
chetan dhumane
Ranch Hand

Joined: Jan 07, 2009
Posts: 629

What if i change the screen first and then change the contentView
Imran Mohd
Ranch Hand

Joined: Mar 02, 2009
Posts: 38
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

Joined: Jan 07, 2009
Posts: 629


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

Joined: Oct 12, 2008
Posts: 1369
    
    1

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.


[List of FAQs] | [Android FAQ] | [Samuh Varta]
 
Don't get me started about those stupid light bulbs.
 
subject: Screen changing
 
Similar Threads
interface and constructor
Inserting an image
View in MVC
Cannot find the problem in the code
webview help......