android - view is not getting inflated after a fragment is added on the framelayout -
i have strange problem, placed layout files in layout-large-land(landscape mode) folder , and added fragment on button click... fragment correctly inflated , if try add more fragments fragment issue view not showing, tried toast message in oncreateview, strangely toast showing view not showing, strange part code portrait mode working fine, newbie android can help..
this fragment call
chooseactivity.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub system.out.println("captain"); addfragment(new chooseactivityfragment(), true, fragmenttransaction.transit_none, "choose_activity"); } });
this added fragment
@override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { system.out.println("-----oncreateview"); view view = inflater.inflate(r.layout.choose_activity_new, container, false); system.out.println("-----oncreateview inside:" + view.getid()); toast.maketext(getactivity(), "oncreate view choose activity", 1) .show(); return view; }
here code add fragment
public void addfragment(fragment fragment, boolean addtobackstack, int transition, string name) { system.out.println("aaaaaaaaaaaaaaaaaaaa"); fragmenttransaction ft = getactivity().getsupportfragmentmanager() .begintransaction(); // ft.replace(r.id.content_frame, couponsfragment); ft.add(r.id.tabcontent, fragment); ft.addtobackstack(name); ft.commit(); }
Comments
Post a Comment