Hi all,

I have an app that work with a backend.
I want to add to multiple activities in it a small user UI, which shows a 
nice "Hello guest" + login button, or a "Hello <user>" + logout.

It was clear to me that I should do it with a fragment, and it is also 
clear to me that I don't want one layout for both cases.
Instead, I want two separated layouts, and to load the right layout 
according to user state.

The problem is - after showing the "guest" layout and nicely log-in in a 
background thread, the fragment's broadcast receiver gets the knowledge the 
user was logged in, but I fail to find a way to simply replace the layout 
of the fragment.

At first creation, the method "public View onCreateView(LayoutInflater 
inflater, ViewGroup container, Bundle savedInstanceState)" is called, and 
the returned view has the inflated layout needed.
Keeping this returned View and updating its values does not effect anything.
Even saving the container (regardless the other problem, which is the fact 
that if the fragment was created from XML this container will be null) and 
inflating into it does not work.

I know I can use different fragments (one for guest and one for logged-in 
user) and change between them in the activity, but this is not my goal, and 
it is not modular enough.

Any ideas ?
Any suggestions ?

Thanks !
Shushu Inbar
Mobile4Social.com

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to