Android Question Possible bug on Debug Mode?

Teech

Member
Licensed User
Longtime User
I created an app with the following components:

- Main Activity (obvoiusly) with a layout containing a ListView and a Button
- Class for manage my object
- Class that encapsulate a list of my objects (collection)
- Second Activity with a layout containing view to modify my objects

In Main Activity I show in ListView all my objects conteined on collection Class.
When Button is clicked a new object is created (and stored in a typed module variable) and i execute a CallSubDelayed2("SecondActivity","MySub",objectVariable): objectVariable is passed by reference.
On SecondActivity.MySub i store the objectVariable in another typed module variable ever by reference (myVar=objectVariable).
In SecondActivity myVar is modified and then is called Activity.Finish.
Now, in Main Activity_Resume i check objectVariable to perform other actions: i aspect objectVariable modified because in ever passed as reference.

When I run the project in debug mode using brakpoint before the CallSubDelayed2 all work corractly, but if I set a breakpoint only on Activity_Resume (Main Activity) objectVariable is Null.

Another strangeness is:
- run project without breakpoint before CallSubDelayed2 --> objectVariable is Null in Activity_Resume
- set breakpoint before CallSubDelayed2 without stopping project --> objectVariable is correct in Activity_Resume
- remove all breackpoint --> run correctly until stop project.

This problem does not occurs in Release mode

Is this a bug?
 

Teech

Member
Licensed User
Longtime User
I extracted part of my project.
If you click on menu in Main Activity, select "Categories" and try to add a new item (with button) you could verify.
 

Attachments

  • test.zip
    126.1 KB · Views: 122
Upvote 0

Teech

Member
Licensed User
Longtime User
The error occurs without breakpoint: is not an error but nothing is added in the ListView because in CategoriesManager.Resume edit_category is Null
The error does not occurs adding a breakpoint on CategoriesManager line 62.
 
Upvote 0
Top