I used the SlidingMenu library in my application, according to https://github.com/xamarin/monodroid-samples/tree/master/SlidingMenu. I build and run application successfully on the android 4.0+, but I failed run application on the android 2.2, but I saw the android sliding menu https://github.com/jfeinstein10/SlidingMenu, it supports from android 2.1.
This is error code:
at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr,Android.Runtime.JValue[]) <0x00088>
at Com.Slidingmenu.Lib.App.SlidingActivity.SetBehindContentView (int) <0x00237>
at regrecall.HomeActivity.OnCreate (Android.OS.Bundle) <0x00097>
at Com.Slidingmenu.Lib.App.SlidingActivity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) <0x0005f>
at (wrapper dynamic-method) object.ffcb4990-4b21-40ac-9622-acbf3c40174b (intptr,intptr,intptr) <0x00043>
--- End of managed exception stack trace ---
android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.ListView
at android.view.LayoutInflater.createView(LayoutInflater.java:513)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.slidingmenu.lib.app.SlidingActivity.setBehindContentView(SlidingActivity.java:83)
at regrecall.HomeActivity.n_onCreate(Native Method)
at regrecall.HomeActivity.onCreate(HomeActivity.java:32)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at android.widget.ListView.<init>(ListView.java:153)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
at android.view.LayoutInflater.createView(LayoutInflater.java:500)
... 22 more
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/common_background.png from drawable resource ID #0x7f020081: .xml extension required
at android.content.res.Resources.loadColorStateList(Resources.java:1824)
at android.content.res.TypedArray.getColor(TypedArray.java:319)
at android.widget.AbsListView.<init>(AbsListView.java:554)
at android.widget.ListView.<init>(ListView.java:157)
... 26 more
Forget me that I can't copy whole log, since the logs on the another machine can't connect to network. I analyse this log, it crashed at SldingMenuActivity onCreate method, it failed to create the listview for the behind view on the activity, but it can work on the android 4.0+, it's too strange.
The problem I found: my listview can't infalte on android 2.2, even my layout is so simple below
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/Home_MenuList"
/>
</LinearLayout>