android - Should a ViewPager that creates ListFragments have each ListFragment call back to the ViewPager to handle list item clicks? -


i have activity viewpager part of layout creates series of listfragments pages. when user clicks on list item in 1 of listfragments, takes them detail page allows them edit details of list item.

so in listfragment's onlistitemclick() method, first check see if in tablet (two-pane) mode, , if is, perform fragment transaction replaces right-hand detail fragment detail fragment newly clicked list item. if running on normal phone, create new activity takes entire screen. basically, have listfragment perform new fragment/activity creation when user clicks on 1 of items.

but instead, should listfragment's onlistitemclick() method call viewpager activity, , have viewpager activity contain fragment/activity creation code?

the problem viewpager activity can create fragments, cannot see how can have each listfragment call custom listfragment parent activity. far can tell, listfragment must have viewpager activity parent activity. if case, practice listfragment call viewpager parent activity handle fragment/activity creation list item clicks?


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -