I am trying to get my action bar to have the up arrow to go back to my menu why will it not work...this is my code...it works if I have a web view on another app what will it not work here?.....can someone please help and no one liners and give me a reason it will not work...I have tried to redo it and it still will not work!!
import android.app.ActionBar;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.TabHost;
public class About extends TabActivity {
private static TabHost tabHost;
private static Intent intent;
private static TabHost.TabSpec spec;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
tabHost = getTabHost();
intent = new Intent().setClass(this, About1.class);
spec = tabHost.newTabSpec("about").setIndicator("ABOUT US").setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, About2.class);
spec = tabHost.newTabSpec("instructors").setIndicator("INSTRUCTORS").setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, About3.class);
spec = tabHost.newTabSpec("disciplines").setIndicator("DISCIPLINES").setContent(intent);
tabHost.addTab(spec);
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// Respond to the action bar's Up/Home button
case android.R.id.home:
Intent listintent = new Intent(About.this,Menu.class);
startActivity(listintent);
return true;
}
return super.onOptionsItemSelected(item);
}
}