I have application that uses the SlidingMenu
library. It' is essentially a Fragment
in the main Activity
that goes in and out of view when user swypes (e.g Youtube, Google+, Facebook).
The top LinearLayout
in this SlidingMenu
has some Dynamic information in it. Such as Login and other info that changes as the users interacts within the app.
One example: The user opens app, that layout in SlidingMenu
says "Log in". They go into overflow
menu, start Login Activity
(over MainFragmentActivity
), signs in successfully, and Login Activity
dissapears. Next time they swipe the menu open, they should see their user name, profile stats, profile picture, etc.
My question: How do I dynamically change this layout without using a refresh button?
Does this include using:
onCreateView()
method in the fragment
?
Note: Currently, it only updates when app starts. It starts an AsynTask
to download things from MySQL
. It seems like a waste of resources to hit the DB everytime user opens the panel, is there a more efficient way of using this?