Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static final String PREFS_NAME = "Preferences";
- SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
- settings.edit().putBoolean("tela_1", true).apply();
- boolean tela1 = settings.getBoolean("tela_1",false);
- if (tela1)
- //defina o botão como visualizado
- else
- //defina o botão como NÃO visualizado
- ImageView imgTela1= (ImageView) findViewById(R.id.imgTela1);
- imgTela1.setImageResource(R.drawable.ic_visualizado);
- if (tela1)
- imgTela1.setImageResource(R.drawable.ic_visualizado);
- else
- imgTela1.setImageResource(R.drawable.ic_nao_visualizado);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement