Skip to content Skip to sidebar Skip to footer

Create Listview With Fragment At Dynamically In Android

I need to create ListView with Fragment at my Sample Screen Shot View. Screen Shots are I know it is possible. But how do workout this types of Fragment at dynamically. I have no

Solution 1:

I suggest you read this article : here And then take a look at this example : here

Solution 2:

This answer is for those who all searching the answer for same question. The answer is achieved by FragmentManager and FragmentTransaction with the following syntax.

FragmentManagerfragmentManager= getFragmentManager();
FragmentTransactionfragmentTransaction= fragmentManager.beginTransaction();

then you need to add your fragment to this fragmentTransaction with the following syntax.

fragmentTransaction.replace(R.id.detailFragment, layout1);

And finally you MUST commit your transaction. Otherwise changes will not persist.

fragmentTransaction.commit();

Post a Comment for "Create Listview With Fragment At Dynamically In Android"