I’m working on an app for a long time and I used so far the theme with the action bar on the top.
Now in the action bar i have the 3 dots sign (using galaxy nexus).
I decided that i don’t want the action bar anymore, and when i take it off through the Manifest i don’t get it below like i should.
any ideas why?
thank you.
this is the code for the actibity:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//initialize
this.spMain = getSharedPreferences("main", 0);
this.numofcourses = this.spMain.getInt("numofcources", 0);
this.tvTotalAvarge = (TextView)findViewById(R.id.totalAvarage);
this.mainLayout = (LinearLayout)findViewById(R.id.mainlayout);
if(this.numofcourses ==0) {
Intent intent = new Intent(this,Newuser.class);
startActivity(intent);
finish();
}
else this.loadCourses();
}
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
Intent intent =new Intent(this, Newuser.class);
startActivity(intent);
finish();
return true;
}
Check out the article Say Goodbye to the Menu Button
If your app runs on a device without a dedicated Menu button, the system decides whether to add the action overflow to the navigation bar based on which API levels you declare to support in the manifest element. The logic boils down to:
If you set either minSdkVersion or targetSdkVersion to 11 or higher, the system will not add the legacy overflow button.
Otherwise, the system will add the legacy overflow button when running on Android 3.0 or higher.
The only exception is that if you set minSdkVersion to 10 or lower, set targetSdkVersion to 11, 12, or 13, and you do not use ActionBar, the system will add the legacy overflow button when running your app on a handset with Android 4.0 or higher.