How to create a semi-transparent instruction page in Android?

前端 未结 4 1266
花落未央
花落未央 2021-01-30 02:55

I am new to Android and trying to work on this problem for last 2 days but could find a solution. Any help will be highly appreciated. How to create a semi-transparent page for

4条回答
  •  [愿得一人]
    2021-01-30 03:06

    You can try this example for showing first time instruction screen without any other libraries
    if you want to show instruction only at the first time, you can add some flags to Preference storage. An example can be found here

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        SharedPreferences pref= PreferenceManager.getDefaultSharedPreferences(getBaseContext());
        boolean check = pref.getBoolean("firstime", true);
        if(check==true){
            Intent i = new Intent(MainActivity.this, Tutorial_screen.class);//starting activity for the Frist time
            startActivity(i);
        }
    

提交回复
热议问题