だから...私は正常に実行されているスプラッシュ画面を開発しました。どうすれば1回(そして1回だけ)実行できますか?登録画面を作成したいのですが、ユーザーに一度だけ表示したいのですが。
ヘルプ!
アマニスワン
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.content.Intent;
import com.nfc.linkingmanager.R;
public class SplashScreen extends Activity {
private boolean mIsBackButtonPressed;
private static final int SPLASH_DURATION = 1000;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash_screen);
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
finish();
if (!mIsBackButtonPressed) {
Intent intent = new Intent(SplashScreen.this, NewCore.class);
SplashScreen.this.startActivity(intent);
}
}
}, SPLASH_DURATION);
}
@Override
public void onBackPressed() {
mIsBackButtonPressed = true;
super.onBackPressed();
}
}