Skip to content

Crash when recreating MainActivity #3784

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

Closed
macgills opened this issue May 29, 2020 · 0 comments · Fixed by #3787
Closed

Crash when recreating MainActivity #3784

macgills opened this issue May 29, 2020 · 0 comments · Fixed by #3787

Comments

@macgills
Copy link
Contributor

Summary:

ContributonListFragment does not have an empty constructor because of this

  ContributionsListFragment(final Callback callback) {
    this.callback = callback;
  }

The code must be rewritten to not pass the callback into the constructor.

Steps to reproduce:

Turn on "don't keep activities"
rotate device on main screen

System logs:

Caused by: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment fr.free.nrw.commons.contributions.ContributionsListFragment: could not find Fragment constructor

Commons app version:

master

ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this issue May 29, 2020
* Added empty constructor in ContributionsListFragment
* Initialise ContributionsListFragment's callaback in onAttach
neslihanturan pushed a commit that referenced this issue Jun 5, 2020
* Added empty constructor in ContributionsListFragment
* Initialise ContributionsListFragment's callaback in onAttach
ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this issue Oct 10, 2020
* Added empty constructor in ContributionsListFragment
* Initialise ContributionsListFragment's callaback in onAttach
ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this issue Oct 10, 2020
* Added empty constructor in ContributionsListFragment
* Initialise ContributionsListFragment's callaback in onAttach
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

Successfully merging a pull request may close this issue.

1 participant