У меня есть меню параметров с меню подпунктов
Мое приложение падает, когда я нажимаю на меню параметров, но я не могу расшифровать журналы
Я хочу, чтобы кнопка выбора открывала 3 пункта меню параметров
Я проверил несколько учебных пособий, но не вижу, в чем я не прав
<?xml version="1.0" encoding="utf-8"?>
<item
android:id="@+id/search_button_main_activity"
android:icon="@drawable/search_button"
android:title="@string/search_button"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/notifications_button"
android:title="@string/notifications_button"
app:showAsAction="never" />
<item
android:id="@+id/help_button"
android:orderInCategory="100"
android:title="@string/help_button"
app:showAsAction="never" />
<item
android:id="@+id/about_button"
android:orderInCategory="100"
android:title="@string/about_button"
app:showAsAction="never" />
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_activity_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.search_button_main_activity:
this.launchSearchActivity();
return true;
case R.id.notifications_button:
Toast.makeText(this, "This will launch notification feature", Toast.LENGTH_SHORT).show();
return true;
case R.id.about_button:
Toast.makeText(this, "This will launch about feature", Toast.LENGTH_SHORT).show();
return true;
case R.id.help_button:
Toast.makeText(this, "This will launch help feature", Toast.LENGTH_SHORT).show();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
вот сообщение об ошибке:
2019-07-01 16:12:46.581 com.matt.android.mynews E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.matt.android.mynews, PID: 7624
android.view.InflateException: Binary XML file line #51: Binary XML file line #51: Error inflating class TextView
Caused by: android.view.InflateException: Binary XML file line #51: Error inflating class TextView
Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 4: TypedValue{t=0x2/d=0x1010099 a=1}
at android.content.res.TypedArray.getColor(TypedArray.java:461)
at android.widget.TextView.<init>(TextView.java:771)
at android.widget.TextView.<init>(TextView.java:704)
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:87)
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:83)
at android.support.v7.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:177)
at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:102)
at android.support.v7.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1266)
at android.support.v7.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1316)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:752)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:883)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:886)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:886)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
at android.view.LayoutInflater.inflate(LayoutInflater.java:522)
at android.view.LayoutInflater.inflate(LayoutInflater.java:430)
at android.support.v7.view.menu.MenuAdapter.getView(MenuAdapter.java:94)
at android.support.v7.view.menu.MenuPopup.measureIndividualMenuWidth(MenuPopup.java:161)
at android.support.v7.view.menu.StandardMenuPopup.tryShow(StandardMenuPopup.java:174)
at android.support.v7.view.menu.StandardMenuPopup.show(StandardMenuPopup.java:208)
at android.support.v7.view.menu.MenuPopupHelper.showPopup(MenuPopupHelper.java:290)
at android.support.v7.view.menu.MenuPopupHelper.tryShow(MenuPopupHelper.java:177)
at android.support.v7.widget.ActionMenuPresenter$OpenOverflowRunnable.run(ActionMenuPresenter.java:806)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6228)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
Логи не могут сказать мне, откуда произошел сбой