Create dedicated menu to avoid crash due to missing theme attr

This commit is contained in:
Benoit Marty 2021-06-10 22:45:52 +02:00 committed by Benoit Marty
parent 0a065b0752
commit 8103c76030
2 changed files with 18 additions and 1 deletions

View file

@ -66,7 +66,7 @@ abstract class DebugMaterialThemeActivity : AppCompatActivity() {
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.home, menu)
menuInflater.inflate(R.menu.menu_debug, menu)
return true
}
}

View file

@ -0,0 +1,17 @@
<?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/menuDebug1"
android:icon="@drawable/ic_edit"
android:title="@string/edit"
app:showAsAction="never" />
<item
android:id="@+id/menuDebug2"
android:icon="@drawable/ic_send"
android:title="@string/send"
app:showAsAction="always" />
</menu>