How best to organize the switch. There are expenses and income. I thought to make the switch through the listview.setVisibility But hemorrhoids due to the heap of trash in one activit Divided into two activitos incomes and expenses. But it turned out that, duplicating your buttons, is a new obrobotchik. And it gets when switching everything blinks, updated to a new layout. I thought to make a listview one-on-one with the visibility property, and during the second one, use the first one's layout layout, but switch visibility. Is this an adequate and correct solution?
- oneFor such a pattern is TabLayout and ViewPager. What you have been thinking about is not only an inadequate and incorrect solution, but some kind of trash. Why don’t you have to torture yourself by looking for your own ways in what has long been invented, not to read a development book (for example, B. Phillips or P. Deythela) and spend time on development, rather than inventing hellish designs. - pavlofff
|
1 answer
In this case, it is better to use fragments (Fragment), but you will not create new Activities for each screen. With fragments and the application will work correctly and you will have fewer problems in the future.
- But I can not stand the fragments, they certainly will not be less problems. For example, when you rotate the screen, you will have a re-created fragment that is not attached to the activation. I would do it without fragments all in one activit. - Real KEK
- Turning problems are easily solved, which means "I can not stand" a person asks how to do it right, and not how you like. - Armen Mkhitaryan
- I don’t like them alone https://habrahabr.ru/post/277289/ - Real KEK
- Unpersuasively, since Google recommends using fragments, then this is a kind of established standard, and the fact that it is not clear who abandoned fragments and recommends that everyone do this means nothing. In any case, everyone chooses what suits him best. - Armen Mkhitaryan
|