Saturday, 15 August 2015

Android twopane layout on fragment creates null object -


itemprop = "text">

I have a piece square from this call, twopane layout invoices_view.xml

  Lt; Piece class = "lk.ezbiz.mobile.ui.InvoiceListFragment" android: id = "@ + id / contact_list" Android: layout_height = "match_parent" Android: layout_width = "0dp" Android: layout_weight = "@ integer / contact_list_percent" / & Gt; & Lt; Piece class = "lk.ezbiz.mobile.ui.InvoiceDetailFragment" android: id = "@ + id / CONTACT_DETAIL" Android: layout_height = "match_parent" Android: layout_width = "0dp" Android: layout_weight = "@ integer / contact_detail_percent" / & Gt;  

and my class is,

  @Override public view onCreateView (LayoutInflater inflater, ViewGroup container, savedInstanceState bundle) {see rootView = Null; {RootView = inflater.inflate (R.layout.invoices_view, Container, False); Log D. (Tag, "On Crate View"); IsTwoPaneLayout = getResources (). GetBoolean (R.bool.has_two_panes); If (isTwoPaneLayout) {mInvoiceDetailFragment = (InvoiceDetailFragment) getActivity () getSupportFragmentManager () findFragmentById (R.id.contact_detail) .. }} Hold (Exception Pre) {Log. E (Tag, "On Createview:" + East .Stosting ()); } Return route view; }  

Selected items in the left pane I need to use this InvoiceDetailFragment object (mInvoiceDetailFragment), but to show its null, if the main square is an activity it works fine, But I need someone to help me to be a piece of main square.

Get (instead of getActportFragmentManager to nest pieces within pieces getChildFragmentManager ())


No comments:

Post a Comment