On 27.03.2018 at 16:23 Philippe Simons wrote:
> it's possible since NativeActivity extends framework Activity, you
> have access to the native ActionBar.
> So you should be able to setup a menu to it.
Hmm, are you sure that this is possible? I'm having a really hard time
trying to get an ActionBar on top of my NativeActivity. It's very hard
to find sample code because obviously everybody uses the AppCompat-style
bars which I cannot use because of NativeActivity.
So I've tried the following instead:
public class MyActivity extends android.app.NativeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
this.requestWindowFeature(Window.FEATURE_ACTION_BAR);
super.onCreate(savedInstanceState);
getActionBar().show();
}
}
But it doesn't work. No ActionBar is shown. Any ideas?