Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4android > Basic4android Updates and Questions
Documentation Wiki Register Members List Windows Mobile Search Today's Posts Mark Forums Read

Basic4android Updates and Questions Updates and questions regarding Basic4android.

MsgBox2 causes android.util.AndroidRuntimeException

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-07-2012, 08:12 PM
thedesolatesoul's Avatar
Basic4android Veteran
 
Join Date: Jun 2011
Location: Hertfordshire, UK
Posts: 1,992
Send a message via Yahoo to thedesolatesoul
Default MsgBox2 causes android.util.AndroidRuntimeException

Some of my code runs fine on a Froyo Emulator, but on ICS 4.0.4 (CM9 Nightly) I get the following exception.

From what I have read so far it seems that the same message is being posted twice in the message queue.

As download/upload transfers are happening in the background (with a possible timer running too), I show a messagebox to confirm deleting download history. At that point this exception is generated:
Code:
android.util.AndroidRuntimeException: { what=0 when=-12h1m24s814ms } This message is already in use.
    at android.os.MessageQueue.enqueueMessage(MessageQueue.java:
187)
    at android.os.Handler.sendMessageAtTime(Handler.java:
473)
    at android.os.Handler.sendMessageDelayed(Handler.java:
446)
    at android.os.Handler.sendMessage(Handler.java:
383)
    at anywheresoftware.b4a.Msgbox.waitForMessage(
Msgbox.java:172)
    at anywheresoftware.b4a.Msgbox.msgbox(
Msgbox.java:127)
    at anywheresoftware.b4a.keywords.Common.Msgbox2(Common.java:
404)
    at com.maximus.dropboxexample.main._clearalltransfers(main.java:
1286)
    at com.maximus.dropboxexample.main._ab_itemclicked(main.java:
328)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:
511)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
105)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
93)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:
89)
    at de.amberhome.SimpleActionBar.ActionBar$Action.select(ActionBar.java:
1683)
    at de.amberhome.SimpleActionBar.ActionBar$
2.onClick(ActionBar.java:262)
    at android.view.View.performClick(
View.java:3511)
    at android.view.View$PerformClick.run(
View.java:14105)
    at android.os.Handler.handleCallback(Handler.java:
605)
    at android.os.Handler.dispatchMessage(Handler.java:
92)
    at android.os.Looper.loop(Looper.java:
137)
    at android.app.ActivityThread.main(ActivityThread.java:
4424)
    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:
787)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
554)
    at dalvik.system.NativeStart.main(Native Method)
Later on I also get this one, but I think its harmless:
Code:
libcore.io.ErrnoException: kill failed: ESRCH (No such process)
    at libcore.io.Posix.kill(Native Method)
    at libcore.io.ForwardingOs.kill(ForwardingOs.java:
77)
    at java.lang.ProcessManager$ProcessImpl.destroy(ProcessManager.java:
257)
    at anywheresoftware.b4a.phone.Phone$
LogCat.LogCatStop(Phone.java:758)
    at anywheresoftware.b4a.b4abridge.service1._stoplogcat(service1.java:
510)
    at anywheresoftware.b4a.b4abridge.service1._streams_newdata(service1.java:
565)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:
511)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
136)
    at anywheresoftware.b4a.BA$
2.run(BA.java:244)
    at android.os.Handler.handleCallback(Handler.java:
605)
    at android.os.Handler.dispatchMessage(Handler.java:
92)
    at android.os.Looper.loop(Looper.java:
137)
    at android.app.ActivityThread.main(ActivityThread.java:
4424)
    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:
787)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
554)
    at dalvik.system.NativeStart.main(Native Method)
Reply With Quote
  #2 (permalink)  
Old 05-08-2012, 03:47 AM
margret's Avatar
Basic4android Veteran
 
Join Date: Jun 2011
Location: USA
Posts: 1,177
Smile

I am running ICS 4.0.3 and do not see this error with the msgbox2(). I know this does not help but wanted to give you feedback from my end.
Reply With Quote
  #3 (permalink)  
Old 05-08-2012, 06:22 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 25,792
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Android 4.0.3 changes the way that internal messages are handled. I'm familiar with a different issue which is probably related to this one.
The fix might require a library update.

Can you create a small project that demonstrates this issue?
It should be something simple with a msgbox shown inside the ActionBar click event.
Reply With Quote
  #4 (permalink)  
Old 05-08-2012, 07:40 AM
corwin42's Avatar
Basic4android Expert
 
Join Date: Jul 2008
Location: Borchen, Germany
Posts: 878
Send a message via Skype™ to corwin42
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I think in the german forum someone posted a similar problem. See here
__________________
You like my work? Please make a donation
My GitHub repositories: corwin42
My Apps: AmberHome Weather - AmberHome Weather Plus - Minimalistic Clock Widget
Reply With Quote
  #5 (permalink)  
Old 05-08-2012, 07:56 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 25,792
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

It is indeed related. However I want to make sure that this issue is the same. So a test project will still be useful.

The fix will require an update to existing libraries. However the update should be simple.
Reply With Quote
  #6 (permalink)  
Old 05-08-2012, 10:32 PM
thedesolatesoul's Avatar
Basic4android Veteran
 
Join Date: Jun 2011
Location: Hertfordshire, UK
Posts: 1,992
Send a message via Yahoo to thedesolatesoul
Default

It took me a while to reproduce this. Nothing to do with the action bar.
It actually crashes with HttpUtils.
Here is a small example that crashes on ICS for me.
Press the 'Start Timer' button, and then immediately press ''Show Messagebox'.
The unfiltered logs will show the exception.

Also, Erel I am using B4A 1.6 (Core library version 1.57)

Test Device: ICS 4.0.4 (CM9 Nightly) on a Samsung Galaxy S

For now, I am thinking of a non-modal messagebox as a workaround, which raises an event on dismissal.
Reply With Quote
  #7 (permalink)  
Old 05-09-2012, 06:13 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 25,792
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

I'm unable to reproduce it. I've tested it with the emulator (which did reproduce the other 4.0.3 related issues). Can other members please test this?
Reply With Quote
  #8 (permalink)  
Old 05-09-2012, 06:58 AM
Senior Member
 
Join Date: Sep 2008
Location: Brisbane, Australia
Posts: 460
Default

Erel, I'm running android 4.0.3 and b4a 1.8.

What do I need to do to test this?

Regards, Ricky
__________________
Samsung Galaxy S2 running Android ICS 4.0.3
Reply With Quote
  #9 (permalink)  
Old 05-09-2012, 06:59 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 25,792
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Download the example, press on the Timer button and then on the second button.
Reply With Quote
  #10 (permalink)  
Old 05-09-2012, 07:03 AM
Senior Member
 
Join Date: Sep 2008
Location: Brisbane, Australia
Posts: 460
Default

I'll do that when I get home after work
__________________
Samsung Galaxy S2 running Android ICS 4.0.3
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
List on panel error: Java.util.arraylist Shay Basic4android Updates and Questions 2 09-10-2011 08:52 AM
Help on Msgbox2 cnicolapc Basic4android Updates and Questions 0 08-21-2011 07:03 AM
MsgBox2 options MDEnt Basic4android Updates and Questions 2 03-15-2011 05:52 PM
Msgbox2 for Basic4PPC?? tsdt Questions (Windows Mobile) 1 02-15-2011 06:49 AM
Msgbox2 junaidahmed Basic4android Updates and Questions 1 01-29-2011 08:11 AM


All times are GMT. The time now is 07:20 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0