frakbot / GlowPadBackport

A backport of the Android 4.2 GlowPadView that works on the SDK on API levels 4+
246 stars 85 forks source link

android.content.res.Resources$NotFoundException #3

Closed prashantwosti closed 10 years ago

prashantwosti commented 10 years ago

your library is great. it works smoothly on 2.3 to 4.4.2. But I have 1 unknown issue. In my nexus one with 2.3.7, when i touch the ring it force closes. below is the log.

please help.

01-12 14:34:11.787: E/AndroidRuntime(9479): android.content.res.Resources$NotFoundException: Array resource ID #0x0 01-12 14:34:11.787: E/AndroidRuntime(9479): at android.content.res.Resources.obtainTypedArray(Resources.java:432) 01-12 14:34:11.787: E/AndroidRuntime(9479): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.loadDescriptions(GlowPadView.java:1359) 01-12 14:34:11.787: E/AndroidRuntime(9479): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.getTargetDescription(GlowPadView.java:1336) 01-12 14:34:11.787: E/AndroidRuntime(9479): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.announceTargets(GlowPadView.java:1321) 01-12 14:34:11.787: E/AndroidRuntime(9479): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.switchToState(GlowPadView.java:379) 01-12 14:34:11.787: E/AndroidRuntime(9479): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.trySwitchToFirstTouchState(GlowPadView.java:1059) 01-12 14:34:11.787: E/AndroidRuntime(9479): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.handleDown(GlowPadView.java:841) 01-12 14:34:11.787: E/AndroidRuntime(9479): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.onTouchEvent(GlowPadView.java:783)

rock3r commented 10 years ago

I'm going to look into it. It probably is due to some framework function crashing on 2.3 instead of failing silently.

prashantwosti commented 10 years ago

thanks... I'll look forward for your answer of to the error.

Regards,

rock3r commented 10 years ago

Sorry I've kinda disappeared, I've been AFK for a week now. I'll try to get my head around this ASAP.

prashantwosti commented 10 years ago

hey no problem :)

Sorry I've kinda disappeared, I've been AFK for a week now. I'll try to get my head around this ASAP.

— Reply to this email directly or view it on GitHubhttps://github.com/rock3r/GlowPadBackport/issues/3#issuecomment-32782348 .

yun0427 commented 10 years ago

Setting -> Accessibility -> Service Insert and Enable Error

02-06 16:53:16.622: E/AndroidRuntime(16947): android.content.res.Resources$NotFoundException: Array resource ID #0x0 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.content.res.Resources.obtainTypedArray(Resources.java:1370) 02-06 16:53:16.622: E/AndroidRuntime(16947): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.loadDescriptions(GlowPadView.java:1359) 02-06 16:53:16.622: E/AndroidRuntime(16947): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.getTargetDescription(GlowPadView.java:1336) 02-06 16:53:16.622: E/AndroidRuntime(16947): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.announceTargets(GlowPadView.java:1321) 02-06 16:53:16.622: E/AndroidRuntime(16947): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.switchToState(GlowPadView.java:379) 02-06 16:53:16.622: E/AndroidRuntime(16947): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.trySwitchToFirstTouchState(GlowPadView.java:1059) 02-06 16:53:16.622: E/AndroidRuntime(16947): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.handleDown(GlowPadView.java:841) 02-06 16:53:16.622: E/AndroidRuntime(16947): at net.sebastianopoggi.ui.GlowPadBackport.GlowPadView.onTouchEvent(GlowPadView.java:783) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.View.dispatchTouchEvent(View.java:7817) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2441) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2131) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2441) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2131) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2441) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2131) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2441) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2131) 02-06 16:53:16.622: E/AndroidRuntime(16947): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2326) 02-06 16:53:16.622: E/AndroidRuntime(16947): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1612) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.app.Activity.dispatchTouchEvent(Activity.java:2494) 02-06 16:53:16.622: E/AndroidRuntime(16947): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2274) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.View.dispatchPointerEvent(View.java:8025) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4668) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4556) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4150) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4207) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4176) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4261) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4184) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4318) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4150) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4207) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4176) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4184) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4150) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6310) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6248) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6219) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6390) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:188) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.os.MessageQueue.nativePollOnce(Native Method) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.os.MessageQueue.next(MessageQueue.java:132) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.os.Looper.loop(Looper.java:138) 02-06 16:53:16.622: E/AndroidRuntime(16947): at android.app.ActivityThread.main(ActivityThread.java:5455) 02-06 16:53:16.622: E/AndroidRuntime(16947): at java.lang.reflect.Method.invokeNative(Native Method) 02-06 16:53:16.622: E/AndroidRuntime(16947): at java.lang.reflect.Method.invoke(Method.java:525) 02-06 16:53:16.622: E/AndroidRuntime(16947): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209) 02-06 16:53:16.622: E/AndroidRuntime(16947): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025) 02-06 16:53:16.622: E/AndroidRuntime(16947): at dalvik.system.NativeStart.main(Native Method)

shantanu-csedu commented 10 years ago

Work around:

file GlowPadView.java

replace the method named 'loadDescriptions'

private ArrayList loadDescriptions(int resourceId) { try{ TypedArray array = getContext().getResources().obtainTypedArray(resourceId); final int count = array.length(); ArrayList targetContentDescriptions = new ArrayList(count); for (int i = 0; i < count; i++) { String contentDescription = array.getString(i); targetContentDescriptions.add(contentDescription); } array.recycle(); return targetContentDescriptions; }catch(Exception e){ return new ArrayList(); } }

prashantwosti commented 10 years ago

@shantanucse18 it works. Thanks a ton.

prashantwosti commented 10 years ago

@shantanucse18 it works. Thanks a ton.