Hi I have a timer task that check a file every 1 minute
public class MyTimerTask extends TimerTask {
//java.io.File file = new java.io.File("/mnt/sdcard/Bluetooth/1.txt");
java.io.File file = new java.io.File("init.rc");
public void CheckTheFile()
{
if (file.exists())
{
// I want here to start the Activity GetGPS
}
}
@Override
public void run() {
CheckTheFile();
}
}
in the check of file.exists , I want if the file is there , activity called GetGPS.
Thanks.
In your case I would recommend using Handler class. Here’s what I would do:
// somewhere in your activity:
P.S. those are bits of code I use for scrolling timer, but you get the idea
UPD
This should do the job. For timer – just google.timer example
UPD2
my mistake – it should be
Handler _timerHandler = .... for starting activity look here