How to change view after getting successful request android? -


i have piece of code: public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) {

        tableview = inflater.inflate(r.layout.fragment_table, container, false);         view layout = inflater.inflate(r.layout.fragment_1, container, false);           if (roomarray == null || roomarray.isempty()) {             roomarray = gettableslist(new volleycallback() {                  @override                 public void onsuccess(arraylist<roomsclass> result) {                      toast.maketext(getactivity(), "onsuccess", toast.length_long).show();                 }             });         } else {             arraylist<view> tablelist = new arraylist<>();              arraylist<tables> tables;             toast.maketext(getactivity(), "isnotnull", toast.length_long).show();              tables = roomarray.get(0).gettables();             gridlayout gridlayout = (gridlayout) layout.findviewbyid(r.id.grid_layout);             (int = 0; < 1; i++) {                 tableview = inflater.inflate(r.layout.fragment_table, container, false);                 textview textview = (textview) tableview.findviewbyid(r.id.table_number);                 textview.settext(tables.get(i).gettablenumber());                 gridlayout.spec row = gridlayout.spec(i / 5);                 gridlayout.spec col = gridlayout.spec(i);                 gridlayout.layoutparams params = new gridlayout.layoutparams(row, col);                 gridlayout.addview(tablelist.get(i), i, params);             }         }         return layout;     } 

so have onsecces, cant add views fragment. need somehow call methods after onsuccess, inner class can't handle there. right way of doing this?

are inflating 2 fragments in createview?

tableview = inflater.inflate(r.layout.fragment_table, container, false); view layout = inflater.inflate(r.layout.fragment_1, container, false); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -