java - How to show fragment on performing certain action -


this question has answer here:

actually developing app has navigation drawer ,i want use fragment instead of separate activities . want how can done? in advance.

check sample code.hope helps you.

<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:fitssystemwindows="true"     tools:opendrawer="start">  <linearlayout     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical">      <include layout="@layout/toolbar_layout">         <!--the toolbar layout if have toolbar-->     </include>      <framelayout         android:id="@+id/base_container"         android:layout_width="match_parent"         android:layout_height="0dp"         android:layout_weight="1">          <!--the layout need add different             fragments on click of nabigation items-->      </framelayout>  </linearlayout>  <linearlayout     android:layout_width="match_parent"     android:layout_height="match_parent"     android:layout_gravity="start"     android:orientation="vertical">   <!--the navigation drawer items--> </linearlayout> 


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -