shontauro-zz / android-pulltorefresh-and-loadmore

android custom listview,with interaction pattern load more and pull to refresh to load data dinamically
443 stars 190 forks source link

Error no constructor #24

Open hellaesir opened 10 years ago

hellaesir commented 10 years ago

11-27 17:43:19.458 7095-7095/br.com.belaapp.cliente E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{br.com.belaapp.cliente/com.costum.android.widget.LoadMoreListView}: java.lang.InstantiationException: can't instantiate class com.costum.android.widget.LoadMoreListView; no empty constructor at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2016) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2117) at android.app.ActivityThread.access$700(ActivityThread.java:134) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1218) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4867) 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:1007) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.InstantiationException: can't instantiate class com.costum.android.widget.LoadMoreListView; no empty constructor at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1319) at android.app.Instrumentation.newActivity(Instrumentation.java:1068) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2007)             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2117)             at android.app.ActivityThread.access$700(ActivityThread.java:134)             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1218)             at android.os.Handler.dispatchMessage(Handler.java:99)             at android.os.Looper.loop(Looper.java:137)             at android.app.ActivityThread.main(ActivityThread.java:4867)             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:1007)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)             at dalvik.system.NativeStart.main(Native Method)

shiratsu commented 9 years ago

Hello.

I also produced the same error. This error reason is librarie's manifest file.

This project does not have activity.But view is wrtten as activity. so i changed this file

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.widget"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="17" />

</manifest>

I guess SDK-version can be replaced each project. I could run example project by fixing above.

I hope this will help.