Change item of Spinner menu in navigation drawer from fragment

I'm beginner android development.
I want to change item of spinner menu from fragment.
excample layout :
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()


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


Please sign in to leave a comment.