wesley franks
wesley franks

Reputation: 7195

Why is OnStart running twice in this Android code?

@Override
    public void onStart() {
        super.onStart();
        if(bundle != null){

            if(!bundle.containsKey(Constants.EXTRA_RECIPE_KEY) && !bundle.containsKey(Constants.EXTRA_RECIPE_CREATOR_ID)){

                Log.i(TAG, "onStart: bundle does not contain the recipe key and recipe creator id.");

            }else{
                String RECIPE_CREATOR_ID = bundle.getString(Constants.EXTRA_RECIPE_CREATOR_ID);
                String RECIPE_KEY = bundle.getString(Constants.EXTRA_RECIPE_KEY);
                mRecipeKey = RECIPE_KEY;
                mRecipeCreatorId = RECIPE_CREATOR_ID;
                Log.i(TAG, "RecieveRecipeCreatorId: Creator Key = " + mRecipeCreatorId);
                Log.i(TAG, "RecieveRecipeKey: Recipe Key = " + mRecipeKey);
                SetDetailsForIncomingRecipe();
            }

        }else{
            Log.i(TAG, "onStart: bundle is null");
        }


    }

enter image description here

Upvotes: 0

Views: 49

Answers (0)

Related Questions