Example #1
0
 /*
  * 加载主界面,如果用户没有做过设置向导,进入设置向导界面
  * 如果用户已经设置向导, 就直接进入到配置页面
  */
 private void LoadMainUI() {
   boolean setupalready = sp.getBoolean("setupalready", false);
   if (setupalready) {
     Logger.i(TAG, "加载详细信息页面");
     Intent intent = new Intent(this, LostProtectedSettingActivity.class);
     startActivity(intent);
     finish();
   } else {
     Logger.i(TAG, "进入设置向导");
     Intent intent = new Intent(this, Setup1Config.class);
     startActivity(intent);
     overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
   }
 }
Example #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    // 1 . 判断用户是否已经设置 密码
    inflater = LayoutInflater.from(this);
    sp = getSharedPreferences("config", Context.MODE_PRIVATE);

    String password = sp.getString("password", null);
    if (password != null) {
      Logger.i(TAG, "用户设置了密码,弹出界面用户密码输入");
      showNormalEntryDialog();
    } else {
      Logger.i(TAG, "用户没有设置密码");
      showFirstEntryDialog();
    }
  }