Activity that is only launched once after a new install?

后端 未结 2 589
梦谈多话
梦谈多话 2020-12-15 01:40

I want my app to have an activity that shows instruction on how to use the app. However, this \"instruction\" screen shall only be showed once after an install, how do you d

2条回答
  •  情话喂你
    2020-12-15 02:20

    yes, you can fix this problem with SharedPreferences

    SharedPreferences pref;
    SharedPreferences.Editor editor;
    
    pref = getSharedPreferences("firstrun", MODE_PRIVATE);
    editor = pref.edit();
    
    editor.putString("chkRegi","true");
    editor.commit();
    

    Then check String chkRegi ture or false

提交回复
热议问题