im new in android im creating an app and i have a problem with a listfragment, because the list its showing but its overlapping the title bar(i had to add margin top to change t
Revers the order of your activity layout, put list view brfore any other main content
your problem is your setting your list fragment to the whole view Id with this line
// android.R.id.content is the WHOLE screen of your Activity
transaction.add(android.R.id.content,fragmento,"fragmento");
transaction.commit();
Create a FrameLayout in your content_drawer_principal.xml:
<FrameLayout android:id="@+id/list_content"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
then do:
transaction.add(R.id.list_content,fragmento,"fragmento");
transaction.commit();
UPDATE
The real problem here is that your telling your FragmentTransaction to load your FragmentoPrincipalChofer
into android.R.id.content
which is a reserved id
android.R.id.content gives you the root element of a view, without having to know its actual name/type/ID.