YuhanXu / omnidroid

Automatically exported from code.google.com/p/omnidroid
Apache License 2.0
0 stars 0 forks source link

Omnidroid Fatal Error #86

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a new event by selecting any root event.
2. Select add action > Omnidroid > alert message > input message.

What is the expected output? What do you see instead?
Screen should go back to the rule edit activity, an exception occurred instead 
and Android force closes Omnidroid.

Excerpt from log:
W/UsageStats(   56): Something wrong here, didn't expect 
edu.nyu.cs.omnidroid.app to be resumed

D/AndroidRuntime(  250): Shutting down VM

W/dalvikvm(  250): threadid=3: thread exiting with uncaught exception 
(group=0x4001aa28)

E/AndroidRuntime(  250): Uncaught handler: thread main exiting due to uncaught 
exception

E/AndroidRuntime(  250): java.lang.RuntimeException: Unable to start activity 
ComponentInfo{edu.nyu.cs.omnidroid.app/edu.nyu.cs.omnidroid.app.view.simple.Acti
vityChooseRootEvent}: java.lang.IllegalStateException: UIDbHelperStore 
singleton must be initialized via init() before use!

E/AndroidRuntime(  250):    at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)

E/AndroidRuntime(  250):    at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)

E/AndroidRuntime(  250):    at 
android.app.ActivityThread.access$2100(ActivityThread.java:116)

E/AndroidRuntime(  250):    at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)

E/AndroidRuntime(  250):    at android.os.Handler.dispatchMessage(Handler.java:99)

E/AndroidRuntime(  250):    at android.os.Looper.loop(Looper.java:123)

E/AndroidRuntime(  250):    at 
android.app.ActivityThread.main(ActivityThread.java:4203)

E/AndroidRuntime(  250):    at java.lang.reflect.Method.invokeNative(Native 
Method)

E/AndroidRuntime(  250):    at java.lang.reflect.Method.invoke(Method.java:521)

E/AndroidRuntime(  250):    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)

E/AndroidRuntime(  250):    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)

E/AndroidRuntime(  250):    at dalvik.system.NativeStart.main(Native Method)

E/AndroidRuntime(  250): Caused by: java.lang.IllegalStateException: 
UIDbHelperStore singleton must be initialized via init() before use!

E/AndroidRuntime(  250):    at 
edu.nyu.cs.omnidroid.app.view.simple.UIDbHelperStore.instance(UIDbHelperStore.ja
va:45)

E/AndroidRuntime(  250):    at 
edu.nyu.cs.omnidroid.app.view.simple.ActivityChooseRootEvent$AdapterEvents.<init
>(ActivityChooseRootEvent.java:147)

E/AndroidRuntime(  250):    at 
edu.nyu.cs.omnidroid.app.view.simple.ActivityChooseRootEvent.onCreate(ActivityCh
ooseRootEvent.java:63)

E/AndroidRuntime(  250):    at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)

E/AndroidRuntime(  250):    at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)

E/AndroidRuntime(  250):    ... 11 more

Original issue reported on code.google.com by renc...@gmail.com on 18 Jun 2010 at 8:34

Attachments:

GoogleCodeExporter commented 8 years ago
It looks like the problem lies with listview being set to CHOICE_MODE_MULTIPLE 
at ActivityChooseFiltersAndActions.initializeListView(), causing 
listview.getCheckedItemPosition() to return -1 during 
ACTIVITY_RESULT_ADD_ACTION and in effect, causing the 
AdapterRule.addItemToParentPosition() to raise an exception.

This is just a recent change made in r754, which seems to be part of issue 65. 
Changing the mode back to CHOICE_MODE_SINGLE solves the problem, but the 
purpose of CHOICE_MODE_MULTIPLE is still unclear.

Original comment by renc...@gmail.com on 18 Jun 2010 at 8:41

GoogleCodeExporter commented 8 years ago
Agreed.  I have been trying to get Wangchengbin to switch to using multiple for 
ActivitySavedRules.java, but maybe he thought I meant this class instead (see 
http://codereview.appspot.com/1618041/show).  I think you're right though that 
ActivityChooseFiltersAndActions should be using SINGLE.

Original comment by case.and...@gmail.com on 18 Jun 2010 at 9:17

GoogleCodeExporter commented 8 years ago
This causes a fault when you try to add actions also.

Original comment by case.and...@gmail.com on 19 Jun 2010 at 11:29

GoogleCodeExporter commented 8 years ago
Code review @ http://codereview.appspot.com/1723045
Checked-in @ r758

Original comment by renc...@gmail.com on 20 Jun 2010 at 1:22