lucasr / smoothie

[DEPRECATED] Easy async loading for Android's ListView/GridView
985 stars 163 forks source link

Runtime Exception when inflating AsyncListView #21

Closed pirbe7 closed 9 years ago

pirbe7 commented 10 years ago

When i try to inflate the AsyncListView, like this:

AsyncListView mListView = (AsyncListView) findViewById(android.R.id.list);

This is the xml:

          xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@android:id/list"
          android:layout_width="match_parent"
          android:layout_height="match_parent" />```

It gives me this error: 

01-30 23:57:50.765: E/AndroidRuntime(11847): FATAL EXCEPTION: main 01-30 23:57:50.765: E/AndroidRuntime(11847): java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.giscar/br.com.giscar.ui.ACTDeviceSelectAsync}: android.view.InflateException: Binary XML file line #20: Error inflating class org.lucasr.smoothie.AsyncListView 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.os.Handler.dispatchMessage(Handler.java:99) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.os.Looper.loop(Looper.java:123) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.app.ActivityThread.main(ActivityThread.java:3687) 01-30 23:57:50.765: E/AndroidRuntime(11847): at java.lang.reflect.Method.invokeNative(Native Method) 01-30 23:57:50.765: E/AndroidRuntime(11847): at java.lang.reflect.Method.invoke(Method.java:507) 01-30 23:57:50.765: E/AndroidRuntime(11847): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842) 01-30 23:57:50.765: E/AndroidRuntime(11847): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) 01-30 23:57:50.765: E/AndroidRuntime(11847): at dalvik.system.NativeStart.main(Native Method) 01-30 23:57:50.765: E/AndroidRuntime(11847): Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class org.lucasr.smoothie.AsyncListView 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.view.LayoutInflater.createView(LayoutInflater.java:518) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.view.LayoutInflater.inflate(LayoutInflater.java:408) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 01-30 23:57:50.765: E/AndroidRuntime(11847): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:209) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.app.Activity.setContentView(Activity.java:1657) 01-30 23:57:50.765: E/AndroidRuntime(11847): at br.com.giscar.ui.ACTDeviceSelectAsync.onCreate(ACTDeviceSelectAsync.java:41) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615) 01-30 23:57:50.765: E/AndroidRuntime(11847): ... 11 more 01-30 23:57:50.765: E/AndroidRuntime(11847): Caused by: java.lang.reflect.InvocationTargetException 01-30 23:57:50.765: E/AndroidRuntime(11847): at java.lang.reflect.Constructor.constructNative(Native Method) 01-30 23:57:50.765: E/AndroidRuntime(11847): at java.lang.reflect.Constructor.newInstance(Constructor.java:415) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.view.LayoutInflater.createView(LayoutInflater.java:505) 01-30 23:57:50.765: E/AndroidRuntime(11847): ... 21 more 01-30 23:57:50.765: E/AndroidRuntime(11847): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f06009b a=1 r=0x7f06009b} 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.content.res.Resources.loadDrawable(Resources.java:1681) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.content.res.TypedArray.getDrawable(TypedArray.java:601) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.widget.AbsListView.(AbsListView.java:658) 01-30 23:57:50.765: E/AndroidRuntime(11847): at android.widget.ListView.(ListView.java:201) 01-30 23:57:50.765: E/AndroidRuntime(11847): at org.lucasr.smoothie.AsyncListView.(AsyncListView.java:63) 01-30 23:57:50.765: E/AndroidRuntime(11847): at org.lucasr.smoothie.AsyncListView.(AsyncListView.java:58)

theoklink commented 10 years ago

My xml has an additional tag (which i guess is relevant )enclosing your example <org.lucasr.smoothie.AsyncListView .... ....

pirbe7 commented 10 years ago

Sorry, didnt put that in the question, but its on my code. Thats not the problem. Thank you anyway

theoklink commented 10 years ago

As I have also implemented this library, I am curious about this error android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f06009b a=1 r=0x7f06009b} I am not aware that smoothie loads any drawables so the error may be in your code. Try and post on Stackoverflow where you have a greater audience.

pirbe7 commented 10 years ago

I also found this very strange. The fact is, that the activity is "clean", it only has this AsyncListView, nothing more, no drawables, nothing. I will ask at Stackoverflow... Thanks again.