xujinyang/BiuEditText

Show error

tellfa opened this issue · 1 comments

Hi, thanks you for this library
but when use this library, show me this error :

Process: com.tellfa.tasktodo, PID: 18083 android.view.InflateException: Binary XML file line #34: Error inflating class me.james.biuedittext.BiuEditText at android.view.LayoutInflater.createView(LayoutInflater.java:633) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at com.tellfa.tasktodo.DialogAdd.onCreateView(DialogAdd.java:45) at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617) at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5349) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at android.view.LayoutInflater.createView(LayoutInflater.java:607) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)  at android.view.LayoutInflater.inflate(LayoutInflater.java:504)  at android.view.LayoutInflater.inflate(LayoutInflater.java:414)  at com.tellfa.tasktodo.DialogAdd.onCreateView(DialogAdd.java:45)  at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)  at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)  at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)  at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)  at android.os.Handler.handleCallback(Handler.java:739)  at android.os.Handler.dispatchMessage(Handler.java:95)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5349)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)  Caused by: java.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.app.Activity at me.james.biuedittext.BiuEditText.init(BiuEditText.java:71) at me.james.biuedittext.BiuEditText.<init>(BiuEditText.java:47) at java.lang.reflect.Constructor.newInstance(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:288)  at android.view.LayoutInflater.createView(LayoutInflater.java:607)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)  at android.view.LayoutInflater.inflate(LayoutInflater.java:504)  at android.view.LayoutInflater.inflate(LayoutInflater.java:414)  at com.tellfa.tasktodo.DialogAdd.onCreateView(DialogAdd.java:45)  at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)  at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)  at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)  at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)  at android.os.Handler.handleCallback(Handler.java:739)  at android.os.Handler.dispatchMessage(Handler.java:95)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5349)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703) 

XMl code : <me.james.biuedittext.BiuEditText android:id="@+id/dialog_add_task" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="biu,biu,发射1号" android:textColor="@android:color/white" app:biu_duration="800" app:biu_text_color="@android:color/white" app:biu_text_scale="1.5" app:biu_type="flydown" app:biu_text_start_size="12sp" />

how can i fix it? thanks

do you add xmlns:app="http://schemas.android.com/apk/res-auto" at root view layout? or import this library in a right way?