android - ViewPager is not showing up on bottomSheetDialog -


viewpager not showing on bottomsheetdialog. here implementation.

public void show(final boxitem boxitem) {         bottomsheet = (mcontext).getlayoutinflater().inflate(r.layout.layout_change_size_and_frequency, null);         bottomsheetdialog.setcontentview(bottomsheet);         bottomsheetdialog.show();         hashmap = boxitem.getfrequencyitemconfighashmap();         initviews();         setupviewpagerandtabs();     }      private void setupviewpagerandtabs() {         set<string> keyset = hashmap.keyset();         viewpageradapter adapter = new viewpageradapter(((appcompatactivity) mcontext).getsupportfragmentmanager());         (string key : keyset) {             adapter.addfragment(searchdetailitemsfragment.getinstance(hash.get(key)), key);         }         viewpager.setadapter(adapter);         tablayout.setupwithviewpager(viewpager);      }      private void initviews() {         tablayout = (tablayout) bottomsheet.findviewbyid(r.id.tabs);         viewpager = (viewpager) bottomsheet.findviewbyid(r.id.viewpager);     } 

fragments not allowed on dialogs. solved problem using bottomsheetdialogfragment allow various things keep fragment's lifecycle.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -