79219156

Date: 2024-11-24 01:22:46
Score: 0.5
Natty:
Report link

You are making it hard on yourself.

Use the NavigationComponent. You'll then never need to make a FragmentTransaction manually, as it is all done internally. Your single activity should be AppCompatActivity, which is inherited from FragmentActivity.

Get rid of Platform.CurrentActivity, whatever that is. In a single Activity app, you can refer to Activity when inside a Fragment. There is only one, so it can never be null.

Look at the new project I mentioned the other day with the new BooksFragment, and check how it's RecyclerView.Adapter works.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: user2153142