I'm trying to start a an activity only after some data is ready in the Service I'm trying this with a timer task which constantly polls the service for the data readness
public class SplashTask extends TimerTask {
@Override
public void run() {
Log.i(MY_DEBUG_TAG, "Internet is accessible, Running some Spalsh screen Tasks ");
if(mBoundService.isDataReady()) {
Log.e(MY_DEBUG_TAG, "Data is ready in service..");
startActivityForResult(new Intent(SplashDroid.this, FunWithDataActivity.class), 3);
} else {
Log.e(MY_DEBUG_TAG, "Data not ready in service..");
}
Log.i(MY_DEBUG_TAG, "Spalsh Tasks fnished..");
}
}
Issue is that when data is ready and FunWithDataActivity about to start, i'm getting the following error
07-27 14:53:40.614: ERROR/AndroidRuntime(1042): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()