Android Question App has stopped. Open app again.

Ronald Berardinis

Member
Licensed User
When I run the application in debug it runs fine and without error.
No error logs exist.
When in release, I get the following error.
upload_2019-2-25_20-45-30.png


I click a button on one form and then launch the form below that shows a list of items numbers.
all looks great.
But when I click exit it gets the "has stopped" error
like I said, works great in debug.

upload_2019-2-25_20-45-7.png


any idea why happening?
should this grid be placed in a panel on the same parent form and not pop up a form on top of the main form?
Thank you.
 

Ronald Berardinis

Member
Licensed User
there are no messages in the log when running in Debug mode.
I don't see messages when release.
code below.
upload_2019-2-26_0-39-4.png
 

Attachments

  • upload_2019-2-26_0-38-30.png
    upload_2019-2-26_0-38-30.png
    43.8 KB · Views: 255
Upvote 0

Ronald Berardinis

Member
Licensed User
I found a solution that appears to fix the problem.
I found this article.
"Using CallSubDelayed to interact between activities and services" by Erel.
i changed the code from this
StartActivity("actPopUp")
to this
CallSubDelayed2("actPopUp","Activity_Create", True )

I am happy. :)
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
CallSubDelayed2("actPopUp","Activity_Create", True )
When you use CallSubDelayed, an Activity that is not running/started will be starter for you. This will call Activity_Create. Once up and running, you are calling Activity_Create again. Why?
 
Upvote 0

Ronald Berardinis

Member
Licensed User
No, the activity actPopUp is only called once.
List of part numbers to do an inventory physical count.
the activity that called actPopUp was actStockTake.
needs to return back to actStockTake.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
If actPopUp was started from actStockTake, all you need to do to return to actStockTake is tap the back button - or if you are intercepting the back button then call Activity.Finish in actPopUp. You shouldn't call Activity_Create.

- Colin.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
If you are calling Activity_Create to make actPopUp work correctly, you're doing something wrong. Most likely, you have code in Activity_Create that should be in Activity_Resume.
 
Upvote 0

Ronald Berardinis

Member
Licensed User
Oliver, not clear.
I tried this.
'StartActivity("actPopUp") comment out
and got errors above.

used below and this seems to work.
CallSubDelayed2("actPopUp","Activity_Create", True )

however, it seems this runs through the activity twice?

definitely not clean and work like I would wish.

what would be in the resume?

BTW, the back arrow gives the same error. Stopped.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
There is obviously something wrong in your code. It's not normal to have a crash when starting or finishing an activity. Your best bet would be to export your project as a zip from the B4A IDE & post it to this thread so we can take a look at it .

- Colin .
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
I suggest reading https://www.b4x.com/android/forum/threads/android-process-and-activities-life-cycle.6487/#content and watching the video posted there. I'm guessing (a guess) that in Activity_Create you are checking the True flag and process something. If Activity_Create is called with false, something bombs out, meaning you are processing something in the true portion that you should be processing no matter what the flag is. This is just a guess. Also, see @Computersmith64's post above this in regards to posting a sample app that crashes.
 
Upvote 0
Top