D
D
Dauren S2016-09-05 08:41:17
Android
Dauren S, 2016-09-05 08:41:17

Detail view open in fragment or activity?

Created recylcer view, there is a list of elements. There is a MainActivity in the onCreate method defined by the Toolbar, TabLayout, DrawerLayout and ViewPager in which the Recycler View is spinning.
Now the question is, on clicking on a list item, do I need to re-create the Activity (DetailActivity)? And again put all the Toolbar, TabLayout, DrawerLayout and ViewPager there. Or do you need to create a fragment?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Ivanov, 2016-09-05
@eastywest

Create in fragment. If in the future the task of displaying RecyclerView and Detail View on the same screen appears, then you will already have ready-made fragments for this. Or you can use a separate activity for detailed display, but with a fragment. Then, in the case of using a tablet, simply do not create this activity, but use a detailed fragment.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question