我想问一下首先要求用户填写个人资料表格以便填写,然后定向到主要活动的逻辑。关闭应用程序然后重新打开后,配置文件活动不应首先启动,而是现在主要活动。我怎样才能做到这一点?我需要帮助。谢谢。
这是我到目前为止所尝试的:
private void doThread(){
Thread timer = new Thread(){
public void run(){
try{
sleep(5000); // sleeps/delays for 3 seconds
} // end try
catch(InterruptedException e){
e.printStackTrace();
}finally{
// this is going to create new intent activity for
// based on the action name (com.fps.ihealthfirst.IHEALTHFIRSACTIVITY)
boolean firstTime = mPreferences.getBoolean("user_prefs", true);
if (firstTime) {
Intent myProfile = new Intent( Disclaimer.this, Profile_Pref.class );
startActivity(myProfile);
}
else{
Intent openIHealthFirst = new Intent( "com.fps.iHealthFirst.IHEALTHFIRSTACTIVITY" );
startActivity( openIHealthFirst );
finish();
}
}// end finally
} // end run method
}; // end thread
timer.start();
}