引导页 设置只显示一次
生活随笔
收集整理的這篇文章主要介紹了
引导页 设置只显示一次
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
// 定義一個setting記錄APP是幾次啟動!!!SharedPreferences setting = getSharedPreferences("com.example.welcome",0);Boolean user_first = setting.getBoolean("FIRST", true);if (user_first) {// 第一次則跳轉到歡迎頁面setting.edit().putBoolean("FIRST", false).commit();} else {// 如果是第二次啟動則直接跳轉到主頁面tiaoZhuan();}
public void tiaoZhuan() {mHandler.post(new Runnable() {@Overridepublic void run() {Intent mIntent = new Intent(WelcomeActivity.this,MainActivity.class);startActivity(mIntent);finish();}});}
May everyone be happy every day and everything go well!
總結
以上是生活随笔為你收集整理的引导页 设置只显示一次的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ButterKnife的简单使用
- 下一篇: EditText修改光标和背景色(绝对简