<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_shuffle"
android:icon="@drawable/rand"
android:orderInCategory="1"
android:showAction="always"
android:title="shuffle"/>
<item
android:id="@+id/action_end"
android:icon="@drawable/end"
android:orderInCategory="2"
android:showAction="always"
android:title="End"/>
</menu>
@Override
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()){
case R.id.action_shuffle:
//shuffle
break;
case R.id.action_end:
stopService(playIntent);
musicSrv=null;
System.exit(0);
break;
}
return super.onOptionsItemSelected(item);
}
Run Code Online (Sandbox Code Playgroud)
我为这件事彻夜难眠。我已经尽了一切努力,但这让我感到非常头疼。
起初是 uri 未注册错误,但在我验证错误后,现在读取如下:
错误:外部资源http://schemas.android.com/apk/res/android未注册。
我如何注册这个?
错误#2
错误:(2, 66) cvc-elt.1.a: 找不到“菜单”元素的声明
错误:文件过早结束
android ×1