In my Android Application I want to have a options menu in the toolbar and the functionality works just fine. However it takes a considerably long time (about one second) until the menu show after the 3 dots in the toolbar are pressed.
At first i thought, that it might be some problem specific to my app, but I created a new project from the Android Studio template and the problem still persists. (Though it feels a little bit faster than in my application)
The menu is created as documented in the docs:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/manageBTConnection"
android:icon="@drawable/ic_bluetooth_white"
android:orderInCategory="100"
android:title="@string/connect"
app:showAsAction="ifRoom" />
<item
android:id="@+id/backgroundService"
android:title="Start background service" />
<item
android:id="@+id/sendToBackend"
android:title="Send to Backend" />
</menu>
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.menu, menu);
return true;
}
Compared to other Android apps it takes a lot longer than usual and feels clunky.
Is there any way to speed up the creation/showing of the dropdown menu?
Many thanks!
I'm experiencing the same thing. Here I've profiled what happens when I tap to open the menu. Notice that it takes 900 to 1000 milliseconds for the menu to appear.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With