我有一个包含飞溅活动的android程序。当我运行该程序的一切完美的工作,但是当PRES后退按钮我看到我的溅活动再次。要能避免这个,看来我需要关闭我的飞溅,但我可以T 这里是我的代码我想关闭我的飞溅活动
package com.tesbih;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
public class Splash extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Thread timer = new Thread(){
public void run(){
try{
sleep(5000);
}catch(InterruptedException e){
e .printStackTrace();
}finally{
Intent openStartingPoint = new Intent ("com.tesbih.TESBIHMAINACTIVITY");
startActivity(openStartingPoint);
}
}
};
timer.start();
}
}
有你看了文档http://developer.android.com/reference/android/app/Activity.html#finish() – Raghunandan
是您的闪屏发射活动为你的应用程序,或者是它从发起活动开始?它看起来像前者,在这种情况下,您当前的活动是您主要活动的父/子堆活动。你应该清理后端堆栈的意图:http://stackoverflow.com/questions/5794506/android-clear-the-back-stack。 – user1676075