java - glowpadview issue with xml -


i have glowpadview issue in xml layout file.

my layout code is:

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:glowpad="http://schemas.android.com/apk/com.fima.glowpadview" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity" >  <com.fima.glowpadview.glowpadview     android:id="@+id/glow_pad_view"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_alignparentbottom="true"     android:layout_centerhorizontal="true"     android:layout_gravity="center_vertical"     android:layout_marginbottom="@dimen/glowpadview_margin_bottom"     android:focusable="true"     android:gravity="center"     glowpad:directiondescriptions="@array/snooze_dismiss_direction_descriptions"     glowpad:feedbackcount="1"     glowpad:glowradius="@dimen/glowpadview_glow_radius"     glowpad:handledrawable="@drawable/ic_alarm_alert_touch_handle"     glowpad:innerradius="@dimen/glowpadview_inner_radius"     glowpad:outerradius="@dimen/glowpadview_target_placement_radius"     glowpad:outerringdrawable="@drawable/ic_alarm_alert_outerring"     glowpad:pointdrawable="@drawable/ic_lockscreen_glowdot"     glowpad:snapmargin="@dimen/glowpadview_snap_margin"     glowpad:targetdescriptions="@array/snooze_dismiss_descriptions"     glowpad:targetdrawables="@array/snooze_dismiss_drawables"     glowpad:vibrationduration="20" /> 

i following error:

the following classes not instantiated:  - com.fima.glowpadview.glowpadview (open class, show error log) see error log (window > show view) more details. tip: use view.isineditmode() in custom views skip code when shown in eclipse  java.lang.illegalstateexception: must specify @ least 1 target drawable     @ com.fima.glowpadview.glowpadview.<init>(glowpadview.java:247)     @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(    @ sun.reflect.nativeconstructoraccessorimpl.newinstance(    @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(    @ java.lang.reflect.constructor.newinstance(    @ com.android.ide.eclipse.adt.internal.editors.layout.projectcallback.instantiateclass(projectcallback.java:442)     @ com.android.ide.eclipse.adt.internal.editors.layout.projectcallback.loadview(projectcallback.java:194)     @ android.view.bridgeinflater.loadcustomview(bridgeinflater.java:206)     @ android.view.bridgeinflater.createviewfromtag(bridgeinflater.java:131)     @ android.view.layoutinflater.rinflate_original(layoutinflater.java:756)     @ android.view.layoutinflater_delegate.rinflate(layoutinflater_delegate.java:64)     @ android.view.layoutinflater.rinflate(layoutinflater.java:728)     @ android.view.layoutinflater.inflate(layoutinflater.java:492)     @ android.view.layoutinflater.inflate(layoutinflater.java:373) 

how resolve this?

there attribute is: glowpad:targetdrawables causes problem, attribute must defined in addition providing @ least 1 valid target drawable.

and see defined it: glowpad:targetdrawables="@array/snooze_dismiss_drawables", problem in file snooze_dismiss_drawables believe contains null values this:

<array name="snooze_dismiss_drawables">     <item>@null</item>     <item>@null</item>     <item>@null</item>     <item>@null</item> </array> 

so make work, define @ least 1 valid drawable in of 4 directions glowpad work, , if want have without visible drables can define transparent drawable , work also, example:

<array name="snooze_dismiss_drawables">     <item>@android:color/transparent</item>     <item>@null</item>     <item>@android:color/transparent</item>     <item>@null</item> </array> 

Comments