原来是我的导航界面两次启动activity。所以一次启动后,有个线程在延时操作,又启动了一遍loginactivity.
new Handler().postDelayed(new Runnable(){
@Override
public void run() {
/* sharedPreferences = getSharedPreferences("logininfo", MODE_PRIVATE);
boolean isStartOnce =sharedPreferences.getBoolean("isStartOnce ", false);
if(isStartOnce ){
Intent intent = new Intent(Weclomescreen.this,MainActivity.class);
Weclomescreen.this.startActivity(intent);
Weclomescreen.this.finish();
startActivityForResult(intent,0);
}else{
sharedPreferences.edit().putBoolean("isStartOnce ", true).commit();
setContentView(R.layout.firstlayout);
}*/
Intent intent = new Intent(Weclomescreen.this,loginActivity.class);
Weclomescreen.this.startActivity(intent);
Weclomescreen.this.finish();
}
//startactivity(intent);
}, SPLASH_DISPLAY_LENGHT);
把stataacitivit注掉就好了,大意失荆州真是,弄了一下午,原来就这么一下。