I have created an android application which runs perfectly in Samsung galaxy ace device. But when I run the same on HTC Desire V, it is giving FATAL EXCEPTION. Note: Samsung device is 3.5 inch screen device while HTC is 4 inch device. The error showing in logcat is as below:
FATAL EXCEPTION: main
java.lang.RuntimeException: Expecting menu, got ScrollView
at android.view.MenuInflater.parseMenu(MenuInflater.java:128)
at android.view.MenuInflater.inflate(MenuInflater.java:95)
at com.pixel.hp.activity.HandpumpActivity.onCreateOptionsMenu(HandpumpActivity.java:1476)
at android.app.Activity.onCreatePanelMenu(Activity.java:2508)
at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:407)
at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:762)
at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:3083)
at android.os.Handler.handleCallback(Handler.java:608)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:4987)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Is it because of change in screen size or something else? Any idea on this would be very helpful.
I am getting error in below method (2nd line is HandpumpActivity.java:1476) :
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_handpump, menu);
return true;
}