Activities Or Fragments In Android?
Solution 1:
Use tabs in the ActionBar, which allows you to use Fragments. When changing tabs, the Fragments will replace, and the previous Fragment will hold its contents.
See Action Bar - Adding Navigation Tabs | Android Developers
Solution 2:
I think you have to use one webview and store content of each page locally for example in DB and then make yourself some navigation bar and reload your webview content by navigation bar. For example navigation bar can be orginized like LinearLayout with Buttons childs. If you use this way - for example you can download 10 web pages at home with your wi-fi and then minimize your app and go for a walk and after some time (even if you use other apps) you can restore all your information from DB, but if you use only fragments in tabs you can loose you pages because of memory lack.
If you use fragments or atcitvities in tab - you can't be sure that previous content will be saved (but you can still do it by adapter and tabhost (there are quite enough samples how to use fragments + tabs)
PS. this is only my opinion and i haven't tried it yet, but i think local store is a best way to resolve your problem.
Post a Comment for "Activities Or Fragments In Android?"