Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking the FAB makes the app crash. #10

Closed
YahiaAWahab opened this issue Apr 24, 2017 · 2 comments
Closed

Clicking the FAB makes the app crash. #10

YahiaAWahab opened this issue Apr 24, 2017 · 2 comments

Comments

@YahiaAWahab
Copy link

The loader should be initialized inside the else statement
This should be used:

Intent intent = getIntent();

        mCurrentPetUri = intent.getData();

        if (mCurrentPetUri == null) {
            setTitle(getString(R.string.editor_activity_title_new_pet));

        } else {
            setTitle(getString(R.string.editor_activity_title_edit_pet));
            getLoaderManager().initLoader(1, null, this);
        }

Instead of this:

Intent intent = getIntent();

 mCurrentPetUri = intent.getData();

        if (mCurrentPetUri == null) {
            setTitle(getString(R.string.editor_activity_title_new_pet));

        } else {
            setTitle(getString(R.string.editor_activity_title_edit_pet));
        }
getLoaderManager().initLoader(1, null, this);
@vcctu85
Copy link

vcctu85 commented Jul 4, 2017

Hi @Yehia961 can you be more specific with your issue so I can help resolve your question?

@javierfurus
Copy link

Thank you so much for this, I had a nullpointer exception and I could not track it down! I knew it was somewhere at the beginning of the EditorActivity but it kinda hid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants