Skip to content

Conversation

@GOVINDDIXIT
Copy link
Member

@GOVINDDIXIT GOVINDDIXIT commented Oct 10, 2018

fixes #626

GIF for the change

ezgif com-video-to-gif

@GOVINDDIXIT
Copy link
Member Author

@nikit19 pls review

Copy link
Member

@nikit19 nikit19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the correct solution.
If the user is on the events fragment and he presses the back button, the app should close.
If he has opened search fragment he should return to the events fragment on backpress. (current behaviour)

@GOVINDDIXIT
Copy link
Member Author

GOVINDDIXIT commented Oct 10, 2018

@nikit19 Updated and Added GIF for the changes. pls review

@iamareebjamal
Copy link
Member

This is a workaround, find why super.onBackPressed is not working

@GOVINDDIXIT
Copy link
Member Author

@iamareebjamal
As the Fragment lifecycle do not have onBackPressed(). So According to me alternative method to override onBackPressed() in Android 3.0 fragments can be done by creating an interface class OnBackPressedListener and Create class which implements skills of OnBackPressedListener and creating a listener and a method to set listener. But the current changes are also preforming same job. So I goes with it.

@iamareebjamal
Copy link
Member

Fragments don't have onBackPressed, their container activity does. Find why it is not working

@GOVINDDIXIT
Copy link
Member Author

GOVINDDIXIT commented Oct 24, 2018

@iamareebjamal @nikit19 pls review

@GOVINDDIXIT
Copy link
Member Author

GOVINDDIXIT commented Oct 26, 2018

@iamareebjamal The problem is with the stack generated. Currently the onBackPressed method is loading the event fragment two times one with loadfragment and then with checkandLoad method. So I had cleared the stack generated everytime the user press the back button and located the user to Event Fragment which is required . Now the user can easily exit the app as there is only 1 fragment in the stack.

@GOVINDDIXIT
Copy link
Member Author

@iamareebjamal I think the issue is solved pls review

@iamareebjamal
Copy link
Member

This is still a workaround. I will see what can be done

@iamareebjamal
Copy link
Member

Old and conflicting with the current logic

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 this pull request may close these issues.

You can't exit the app using the back button

3 participants