0

In Activity's onCreate Method we can do the following

     QuickReturnHeaderHelper helper = new QuickReturnHeaderHelper(this,
                R.layout.activity_product_detail,R.layout.product_details_footer);
     wholeView = helper.createView(productDetailDTO.isOwner());
     setContentView(wholeView);

In fragment,we can return a layout from onCreateView(), we can inflate it from a layout resource defined in XML. To help us do so, onCreateView() provides a LayoutInflater object.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    return inflater.inflate(R.layout.example_fragment, container, false);
}

Now, I want to use

whole view i.e my custom view

as my fragments rootview.I dont want to inflate if from a layout resource defined in XML. But, until now I have not been able to do so. I have been searching in google for past few days but searching didnot produce any result. So, here I am posting this question.

Prativa
  • 364
  • 6
  • 25

1 Answers1

0

I do not get your question completely but in my opinion what you can do is create an empty xml file(with relative layout only) and inflate it then add your custom view to it. Hope this will work, sorry if i was wrong

Asheesh
  • 565
  • 6
  • 21