ü做可以使用共享偏爱这个..
static SharedPreferences notify_Settings;
public static SharedPreferences.Editor editor;
public static final String PREFS_NAME = "Desired Name";
notify_Settings=getSharedPreferences(PREFS_NAME, 0);
SharedPreferences.Editor editor = notify_Settings.edit();
if (settings.getBoolean("firsttime", false) == false){
editor.putBoolean("firsttime",true;
editor.commit();
//Some code here
startActivity(new Intent(Page 1.this, Page 2.class));
}else{
//Some code here
startActivity(new Intent(Page 1.this, Page 3.class));
}
第一次将返回false,因为不会再有如果(条件)变为true并且执行你的过程并将页面重定向到页面上,则在共享首选项中值(即)为假。如果再次运行该应用程序,则此条件将成为虚假的,因为现在共享偏好的值将是“真实的”,所以这样你就可以控制你的页面重定向了。
另外看看这个http://developer.android.com/guide/topics/data/数据storage.html – Venky 2011-03-12 10:22:13