Почему то исчезла стандартная кнопка "Settings" в правом верхнем углу при использование ЛистВью. В чём проблема и как вернуть её обратно? Буду признателен.
public class MainActivity extends ListActivity {
String[] Buttons = new String[100];
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_main);
for (int i=0;i<=99;i++){
Buttons[i]=Integer.toString(i+1);
}
// MyCustomAdapter forData= new MyCustomAdapter(this,Buttons);
setListAdapter(new MyCustomAdapter(this,Buttons));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
Intent intent = new Intent(MainActivity.this,SettingActivity.class);
startActivity(intent);
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
Toast.makeText(this, position + " selected", Toast.LENGTH_LONG).show();
}
}
setListAdapter(new MyCustomAdapter(this,Buttons));
) списку за пределы цикла.