我只在服务中准备好一些数据后才尝试启动一项活动
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..");
}
}
问题是当数据准备好并且 FunWithDataActivity 即将启动时,我收到以下错误
07-27 14:53:40.614: ERROR/AndroidRuntime(1042): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()