This commit is contained in:
Matan Bar Yosef 2016-07-10 14:55:14 +03:00
commit e5d126aeae

View file

@ -136,8 +136,14 @@ public class MainActivity extends AppCompatActivity
// as you specify a parent activity in AndroidManifest.xml. // as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId(); int id = item.getItemId();
Log.d(TAG, "onOptionsItemSelected: id -> "+id);
//noinspection SimplifiableIfStatement //noinspection SimplifiableIfStatement
if (id == R.id.action_settings) { if (id == R.id.action_settings) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
toolbar.setTitle("Settings");
setSupportActionBar(toolbar);
ft.replace(R.id.fragment_container, settingsFragment);
ft.commit();
return true; return true;
} }
@ -148,7 +154,6 @@ public class MainActivity extends AppCompatActivity
@Override @Override
public boolean onNavigationItemSelected(MenuItem item) { public boolean onNavigationItemSelected(MenuItem item) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Bundle b = new Bundle();
int id = item.getItemId(); int id = item.getItemId();