[ 
https://issues.apache.org/jira/browse/CB-1128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422546#comment-13422546
 ] 

Simon MacDonald commented on CB-1128:
-------------------------------------

This is another one of those dialog leaking errors. In order to fix this I 
think we should do the following:

1) In spinnerStop as part of the if where it checks for null then it should 
also check to see if the spinner isShowing.
2) Also, we should wrap the code in spinnerStart so that it is in a Runable and 
then execute it on the UI thread. 
                
> crash while running the Accelerometer documentation example on a 2.3.5 device
> -----------------------------------------------------------------------------
>
>                 Key: CB-1128
>                 URL: https://issues.apache.org/jira/browse/CB-1128
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.0.0
>         Environment: eclipse sdk 4.2 on win32, android sdk r20.0.1 win, adt 
> 20.0.2, cordova-2.0.0, the device is a samsung galaxy s gt-i9000 running 
> android 2.3.5 gingerbread xxjvt
>            Reporter: Alexandru Nicau
>            Assignee: Simon MacDonald
>            Priority: Minor
>              Labels: android, crash
>         Attachments: index.html, logcat.txt
>
>
> Have implemented the Accelerometer full example (from the documentation) and 
> after a few seconds of correct execution it crashes. The situation can be 
> duplicated easily and happens every time. 
> The Java code is: 
> public class MainActivity extends DroidGap {
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         
>         super.setStringProperty("loadingDialog", "Title,Message");
>         super.setStringProperty("errorUrl", 
> "file:///android_asset/www/error.html");
>         super.init();
>         super.appView.clearCache(true);
>         super.setBooleanProperty("keepRunning", false);
>         super.loadUrl("file:///android_asset/www/index.html");
>     }
> }
> The HTML code is a copy-paste from the example at 
> http://docs.phonegap.com/en/2.0.0/cordova_accelerometer_accelerometer.md.html#Accelerometer
>  , accelerometer.watchAcceleration section, the full code sample. That's 
> where a watch is added on the accelerometer, executing the onSuccess() every 
> 3 seconds, which updates some div. 
> Running the application updates the div but only for a variable number of 
> times (maybe one to three updates). The errors we're seeing bellow are at a 
> point when a spinner dialog is about to be shown, but its view cannot be 
> added to the view manager (or the view manager cannot instantiate a new view, 
> don't know code details). Both, IMHO are side effects of the real reasons. If 
> I remove the "loadingDialog" property, the application keeps on crashing, but 
> more quietly than we may see bellow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to