Change item of Spinner menu in navigation drawer from fragment

Hi..
I'm beginner android development.
I want to change item of spinner menu from fragment.
excample layout :
DFG_2015-01-05-22-32-18(1).png
I have "login"fragment, and I want to set item for spinner menu after i was succeed login.
please help me..

sorry for my english

1 comment
Comment actions Permalink

I was try and try in a long time and finally succeed.

this is my solution:
1. in MainActivity code for set menu item:

    ....    
    @Override     protected void onCreate(Bundle savedInstanceState) {         ....         setDrawerItem();         ....     }

    public void setDrawerItem(){
    // set default item of Spinner menu
    ....
    }

    ....


2. in LoginFragment to change item of Spinner menu.
    if login is true and I was geting data to be item of Spinner menu I just call method setDrawerItem()

    ((MainActivity)getActivity()).setDrawerItem();


the problem with this simple solution has been wasting my time in 2 days..:^O:^O:p:^O:)B-)

0

Please sign in to leave a comment.