我有一个名为的主类BaseActivity
,它有一个方法
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getSupportMenuInflater().inflate(R.menu.main, menu);
return true;
}
现在我像这样扩展这个类......
public class MainActivity extends BaseActivity {
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
Log.d("Its called", "Kevin");
menuInflater.inflate(R.menu.othermenu, menu);
}
}
我将如何在这里覆盖此方法,如果它是 aboolean
或void
.
更新:
public class FragmentClass extends android.support.v4.app.Fragment {
// How would i over-ride the onCreateOptionsMenu() here of BaseActivity.
}