in my app user needs to authenticate before he can start using the app..
I have this code in startupActivity

```
private boolean checkAuthentication() {
    SharedPreferences sp = getSharedPreferences(
            "com.simekadam.blindassistant", Context.MODE_PRIVATE);
    return sp.getBoolean("logged", false);
}

private void processStartup(){
    Log.d(TAG, "processing startup");
    if (checkAuthentication()) {
        Intent startApp = new Intent(getApplicationContext(),
                BlindAssistantActivity.class);
        startActivity(startApp);
    } else {

        Intent loginIntent = new Intent(getApplicationContext(), LoginActivity.class);
        startActivity(loginIntent);

    }
}

```

it just works but I need to check it propably in every activity (in onStart or onResume methods), but it would cause code duplications among all my activities. What is the best way how to do this? Can I create a masteractivity which will be extended with other activities?

thanks