当前位置:网站首页>Live app development to determine whether the user is logging in to the platform for the first time

Live app development to determine whether the user is logging in to the platform for the first time

2022-06-11 12:04:00 Yunbao network technology

live broadcast app Development , Determine whether the user is the relevant code implemented by the platform for the first time

@Override protected void onCreate(Bundle savedInstanceState) {
    
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        firstRun();
    }

private void firstRun() {
    
    SharedPreferences sharedPreferences = getSharedPreferences("FirstRun",0);
    Boolean firstrun = sharedPreferences.getBoolean("First",true); if (firstrun){
    
        sharedPreferences.edit().putBoolean("First",false).commit();
        Toast.makeText(this," for the first time ",Toast.LENGTH_LONG).show();
    }
    else {
    
        Toast.makeText(this," Not for the first time ",Toast.LENGTH_LONG).show();
    }
}

That's all live broadcast app Development , Determine whether the user is the relevant code implemented by the platform for the first time , More content welcome to follow the article

原网站

版权声明
本文为[Yunbao network technology]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203012145314866.html