XML : My Action bar menu is not display in another activity but it display in the main Activity only(i'm using Fragment and non Fragment)

In android studio i am beginner,i learn it from the internet tutorial so i'm using navigation drawer with no action bar I create my own action bar and i'm using fragment but when it mix with without fragment only the action bar is display with out actionbar menu items except for the main activity. Here my .xml file below

  <include      android:layout_height="wrap_content"      android:layout_width="match_parent"      layout="@layout/toolbar_layout"      />    <TextView      android:layout_width="wrap_content"      android:layout_height="wrap_content"      android:textAppearance="?android:attr/textAppearanceLarge"      android:text="Large Text"      android:id="@+id/textView"      android:layout_alignParentLeft="true"      android:layout_alignParentStart="true"      android:layout_marginTop="137dp" />    </RelativeLayout>    

And here my java file below
public class Grade_book extends AppCompatActivity {

  @Override  protected void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.grade_book);  }  @Override  public boolean onCreateOptionsMenu(Menu menu) {    getMenuInflater().inflate(R.menu.menu_grade,menu);      return true;  }    

}

No comments:

Post a Comment