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

FavouriteFragment ContextualActionMode delete crash #1

Closed
Push1413 opened this issue Apr 16, 2021 · 3 comments
Closed

FavouriteFragment ContextualActionMode delete crash #1

Push1413 opened this issue Apr 16, 2021 · 3 comments

Comments

@Push1413
Copy link

Steps to replicate crash

  1. Mark 8 to 10 recipes to favorite.(enough to scroll)
  2. By long clicking select favorite recipes such that it must contain one recipe from scroll(or simply select first and last one)
  3. click delete icon from menu

Error report

  • java.lang.IllegalArgumentException: No suitable parent found from the given view. Please provide a valid view.
    at com.google.android.material.snackbar.Snackbar.makeInternal(Snackbar.java:198)
    at com.google.android.material.snackbar.Snackbar.make(Snackbar.java:157)
    at com.example.foody.adapters.FavoriteRecipesAdapter.showSnackBar(FavoriteRecipesAdapter.kt:184)
    at com.example.foody.adapters.FavoriteRecipesAdapter.onActionItemClicked(FavoriteRecipesAdapter.kt:160)
@stevdza-san
Copy link
Owner

Steps to replicate crash

1. Mark 8 to 10 recipes to favorite.(enough to scroll)

2. By long clicking select favorite recipes such that it must contain one recipe from scroll(or simply select first and last one)

3. click delete icon from menu

Error report

* java.lang.IllegalArgumentException: No suitable parent found from the given view. Please provide a valid view.
  at com.google.android.material.snackbar.Snackbar.makeInternal(Snackbar.java:198)
  at com.google.android.material.snackbar.Snackbar.make(Snackbar.java:157)
  at com.example.foody.adapters.FavoriteRecipesAdapter.showSnackBar(FavoriteRecipesAdapter.kt:184)
  at com.example.foody.adapters.FavoriteRecipesAdapter.onActionItemClicked(FavoriteRecipesAdapter.kt:160)

I'm not sure I follow.
You get this error when selecting 8-10 recipes from Favorites and clicking delete button, right?

@Push1413
Copy link
Author

No
You can select 2. Ex- select one at top and for second select any one after you scroll down some screen.
Then come back to top screen by scrolling and then click delete.

For my mobile screen size i stared 5 recipes and by long clicking selected 1st and last recipe. Then came back by scrolling up and after clicking delete from menu it gets crash.

@stevdza-san
Copy link
Owner

No
You can select 2. Ex- select one at top and for second select any one after you scroll down some screen.
Then come back to top screen by scrolling and then click delete.

For my mobile screen size i stared 5 recipes and by long clicking selected 1st and last recipe. Then came back by scrolling up and after clicking delete from menu it gets crash.

I have replicated the steps you've described and everything works fine on my end.
I had that issue, but resolved it few weeks back. I suggest you to use the latest branch which is constantly updating.

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

2 participants