Android Question [SOLVED] B4A When in Second Activity, Main Activity_Resume Fires for No Reason

mmieher

Active Member
Licensed User
Longtime User
I've got six years of B4X under my belt and am just now experimenting with a second Activity Module. I have read lots of posts about it and have watched the Activity Life-cycle video twice.

I made a small project with two Activity modules. I start "Activity2" from "Main" and it works perfectly.
However, in my very large project, when I StartActivity(Activity2) everything is fine for about five seconds, then suddenly Activity_Resume in Main is called, and I am presented with a blank screen. This does not happen in my "small" project.

What could be causing this to happen? I am not touching the device after Activity2 is started. There are no timers going or anything like that.
 

walterf25

Expert
Licensed User
Longtime User
I've got six years of B4X under my belt and am just now experimenting with a second Activity Module. I have read lots of posts about it and have watched the Activity Life-cycle video twice.

I made a small project with two Activity modules. I start "Activity2" from "Main" and it works perfectly.
However, in my very large project, when I StartActivity(Activity2) everything is fine for about five seconds, then suddenly Activity_Resume in Main is called, and I am presented with a blank screen. This does not happen in my "small" project.

What could be causing this to happen? I am not touching the device after Activity2 is started. There are no timers going or anything like that.
It would help a lot if you post your code, or at least the relevant code, without seeing what you are doing we can only speculate.

Are you doing any calls to the Main Activity such as CallSub, or CallSubDelayed from Activity2?

Walter
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
Any type of timer firing in a service or class that is calling a sub in your Main, or referencing an object declared in your Main's process_globals?
 
Upvote 0

mmieher

Active Member
Licensed User
Longtime User
Thanks, Jeffrey and Walter. The code is too much to post.

The Starter service is calling a sub in Main. That turned out to be the problem. Need to work around that.
 
Upvote 0
Top