java - I want to add other content with navigation drawer -


i new android. have created drawer layout using list view (custom list view using base adapter). code activity_main.xml. when run application see empty screen. listview working properly. need add content in screen, mapview or else. , want content move when navigation menu opened. how add content other list view in below code?

  <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android"  android:id="@+id/drawerlayout"  android:layout_width="match_parent"  android:layout_height="match_parent">  <framelayout      android:id="@+id/maincontent"     android:layout_width="match_parent"     android:layout_height="match_parent">   </framelayout>  <listview      android:id="@+id/drawerlist"     android:background="#cecece"     android:divider="@null"     android:layout_width="240dp"     android:layout_height="match_parent"     android:layout_gravity="left"></listview> 

framelayout 1 holds main content. create fragment , layout, on mainactivity add fragment framelayout this.

 myfragment fragment = new myfragment();  fragmenttransaction ft = getsupportfragmentmanager().begintransaction();  ft.add(r.id.maincontent, fragment, "fragment").commit()`;  


Comments