tags:

views:

156

answers:

2

Hi,

How to close screen while moving to next screen in android platform?

i have one working scenario like this. while moving from one screen to other screen need to close(i shouldn't show screen while press Esc key).

Please help me

Regards, Jeyavel N

A: 

I'm assuming that by "screen" you mean "Activity".

All you need to do is call finish() after you call startActivity(). eg.:

startActivity( new Intent( this, Foo.class) );
finish();

That should do it.

Mike
A: 

in my case i hav to navigate frm 1 screen to nthr aftr the timer is completed ... i hav 2 classes named test.java and test2.java!! inside Test.java class i hav created a class named Timer and in that in onFinish() method wen i write

startActivity(new Intent(this,Test2.class)); finish();

eclipse shows an error "The constructor Intent(test.MyTimer, Class) is undefined"

what shall i do??

poojan9118