I need your help because I'm having a hard time making only one user access to a certain activity.
Ex: I am developing an App where settings screen only I will have access with my user, no other. I want to leave this set up in code just my userId with access to the screen.
private void openRestrictedSettings() {
if(userId.equals("id")){
Intent intentRestrictedSettings = new Intent(TelaPrincipalActivity.this, ActivityRestrictedSettings.class);
startActivity(intentRestrictedSettings);
}else {
Toast.makeText(this, "Apenas usuários autorizados podem acessar as configurações", Toast.LENGTH_SHORT).show();
}
}
"userPermissions" exists only in my user, no other user will have this.
How can I make an activity open only by who owns userPermissions?