• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Problem with getting the app first run using shared prefferences

wisien92

Lurker
I am new to android programming and i have found one issue. I want to determin first run of app and with my method the app never starts :/ tha app proces is killed right away.

I want to chech that in my splashscreen activity and here is my code:

Code:
public class SplashScreen extends Activity {

    final Intent mainMenuIntent = new Intent(this, MainMenu.class);

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);

        SharedPreferences app_preferences =               PreferenceManager.getDefaultSharedPreferences(this);

        if (app_preferences.getBoolean("firstTime", false)) {
            Log.v("SplashScreenActivity","Pirszy raz!!!!");
        }

        mainMenuIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
        startActivity(mainMenuIntent);
    }
}
What am I doing wrong here ?
 
after testing a little more :

final Intent mainMenuIntent = new Intent(this, MainMenu.class);

this line coused the app to close :P


But still i recieve no info in log ;/
 
Back
Top Bottom