When i go from screen 1 to screen 2 my app crashes

You are never closing your current screen which can led to OutOfMemory exception.

thanks for talking out your time,
i will surely work on it & inform the behavior of my app
thanks :slightly_smiling_face:

Welcome :slightly_smiling_face:

oh yes! i have done this earlier in my coding before creating this post
the main issue that came after doing this was:-
when i connected to the ai2 companion & this method was applied to switch screens
if i have opened screen 2 and i clicked on a button which opens screen 6(for eg) what happened was as soon as screen 6 was opened it again closes & opened screen 2 which again oped screen 6 & this series was going ... it did not stop :disappointed:
i have to close my companion to stop it

did you meant i should open another screen with this code?

in Screen2 i should use the block which is used here or should i use this block:

You should try this:

ok i will surely try
thanks :relaxed:

i did this to all my screens & built my app
results:- My app is still crashing :frowning_face:
here are the blocks:-
blocks (16)

blocks (20)

thanks & regards
whats wrong in this code????

till now this code was working on ai companion but now its not even working on that
what should i do??
this code is opening a screen but it is opening that screen first that was opened just before it.. if a open a screen before opening any other screen it displays screen 1 first this happens even when i exit a screen

can anyone tell me that is this the right code to change screen using clock?
may be the problem is this
blocks (24)

Please check my codes:-
im sharing screen wise
my first screen:-
blocks (8)

second screen:-

third screen:-

fourth screen:-

fifth screen:-

sixth screen:-

seventh screen:-

eighth screen:-

thanks & regards

Hello Neelam

The only way to do that is to use the "send direct" blocks. However, if the App is to be distributed via Google Play, you cannot send direct - as a security measure last year, Google banned Apps from sending calls and messages, they have to pass the data to the device's default Apps.


Hello Neelam

We are not going to write your App for you! If you see my example code, you need to expand it to use the messages you require. If the safety contact numbers are stored in TinyDb, you can use a TinyDb block to restore the numbers - swap that with the List in my example. Get a List of Tags, then "for each Tag" in List List_PhoneNumberTags.

So show us your new SOS Button code :upside_down_face:

https://www.professorcad.co.uk/appinventortips#TipsApk Cannot Build/Install/Run APK

I don't see that you implemented what was suggested to you before (closing the screens that you are leaving behind). For example, your Screen 1 calls screen 2 in the clock timer event but screen 1 remains in memory because you didn't close it.

Ok, The screen1 initialize shouldn't open screen 2. If you are trying to do a splash screen, the TimerEnabled False and open another screen blocks should be inside the timer event, not in the initialize event.

button 1- SOS button
Button 2- clear button

if you want aia file , i will upload it.. u may inform :slightly_smiling_face:

hello Italo,
i will surely implement this & inform about the behavior of my app
thanks & regards

1 Like

hello @Italo
i applied your code & built my app , here is what it shows(the same what it showed earlier):-

woman safety is the name of my app**
if u say i will share my aia file then u can see what's the issue

Hello Neelam

Some items of note:

  1. Remove the Texting1 Message from Screen 1 Init.
  2. SOS button - you cannot use the Label Blocks there as at the time of initialization, they are empty. Instead, make the List at run time, called after the values are restored from TinyDb.
  3. Why not have the TinyDb Tag Names match the Labels? Eg Tag1, Tag2, etc.

Initialise the labels and the phone number list at the same time:

1 Like