Saturday, 20 June 2015

Adnroid check if current activity is the root/main activity




Intent intent = getIntent();

String action = intent.getAction();             
Set<String> categories = intent.getCategories();
if(action == null || !action.equals("android.intent.action.MAIN")){
    //this is the main activity
}










No comments:

Post a comment