Android tabs+swipe fragments redrawing -
i'm using android feature tabs+swipe application. generated of code. have mainactivity, sectionspageradapter , fragment classes. in application have 2 tabs, created 2 different fragment classes each tab. on first tab need fragment spinner in , table values underneath spinner. need on spinner item selection want redraw same type of fragment different values in table.
also cannot utilize layout xml files fragment cause table not have same number of columns or rows. need programmatically design it's view. cannot utilize nested fragments either cause need application destined lower version of android... , nested fragments newest 4.2 ver.
i have written code based on similar questions found here, still have problem. here fragment class emphasis on spinner selection listener.
public class currencylistfragment extends fragment { ... @override public view oncreateview(layoutinflater inflater, final viewgroup container, bundle savedinstancestate) { spinner.setonitemselectedlistener(new onitemselectedlistener() { ... @override public void onitemselected(adapterview<?> arg0, view arg1, int arg2, long arg3) { ... selection = spinner.getselecteditemposition(); fragmenttransaction trans = getfragmentmanager().begintransaction(); fragment fragment = new currencylistfragment(selection); fragment.setarguments(result); trans.replace(container.getid(), fragment); trans.settransition(fragmenttransaction.transit_fragment_open); trans.addtobackstack(null); trans.commit(); } } }
i skipped parts of code.
i don't why not working ... don't error instead of redrawing same fragment on first tab different table values blank fragment.... nil on it.
is there possible solution this?
android fragment gestures redraw
No comments:
Post a Comment