mainActivity.java
------------------------------
package vadhel.rakesh.mediamca_dataactionbar;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActionBar actionBar=getSupportActionBar();
//actionBar.hide();
actionBar.setTitle("My Title");
actionBar.setSubtitle("subjects");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(1,1,1,"File");
menu.add(1,2,2,"Save");
menu.add(1,3,3,"Help");
return super.onCreateOptionsMenu(menu);
}
}
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActionBar actionBar=getSupportActionBar();
//actionBar.hide();
actionBar.setTitle("My Title");
actionBar.setSubtitle("subjects");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(1,1,1,"File");
menu.add(1,2,2,"Save");
menu.add(1,3,3,"Help");
return super.onCreateOptionsMenu(menu);
}
}