Back key creates black screen

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Cool Dave
Posts: 35
Joined: Mon Jun 25, 2012 8:44 pm

Back key creates black screen

Post by Cool Dave » Sat Oct 20, 2012 7:09 pm

This has be asked before, but there was no answer, so I'll ask it again rather that post on that old thread.

If I hit the back key in my app, the app closes, but it is still open according to task manager. When I try to open it again, it just shows a black screen. Is there something I can do when I trap it to eliminate this behavior?

Thanks in advance.
Dave

qberty1337
Posts: 35
Joined: Sun Sep 09, 2012 1:09 pm

Re: Back key creates black screen

Post by qberty1337 » Sun Oct 21, 2012 2:59 pm

When your app is being run, when the back key is pressed, the "backKey" message is sent to the current Card of the current Stack you are already on.

You can trap the back key by putting

on backKey

end backKey

in your cards script.

Depending on where you are in your app, Android won't actually CLOSE the app. That's what androids whole "multi-tasker" thing is about.

deebee
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 89
Joined: Mon Jul 19, 2010 6:59 am
Location: Illinois, USA

Re: Back key creates black screen

Post by deebee » Sun Oct 21, 2012 4:24 pm

I think this is a known bug that should be fixed for the next minor version release, or so is indicated by support.

Cool Dave
Posts: 35
Joined: Mon Jun 25, 2012 8:44 pm

Re: Back key creates black screen

Post by Cool Dave » Tue Oct 23, 2012 10:42 pm

qberty,

Hitting the back key, unless you have trapped it, does close the app. And also creates this bug. In alomst all android apps, hitting the back button will first navigate to its root menu and then close.

This bug has been around for quite a while, I think. It had better get fixed soon, though, or people will start to complain.

Dave

qberty1337
Posts: 35
Joined: Sun Sep 09, 2012 1:09 pm

Re: Back key creates black screen

Post by qberty1337 » Wed Oct 24, 2012 5:41 am

Cool Dave wrote:qberty,

Hitting the back key, unless you have trapped it, does close the app. And also creates this bug. In alomst all android apps, hitting the back button will first navigate to its root menu and then close.

This bug has been around for quite a while, I think. It had better get fixed soon, though, or people will start to complain.

Dave
It's not a bug. That's how Android's stack UI works.

In a NORMAL android app built from scratch, when pressing back, it only goes back to the pages that the app specifies the backKey will direct to.

SAME thing for LiveCode. Trap it, and tell it where to go. Very simple, and not a bug or big problem.

Cool Dave
Posts: 35
Joined: Mon Jun 25, 2012 8:44 pm

Re: Back key creates black screen

Post by Cool Dave » Sat Oct 27, 2012 11:09 pm

I guess my quoted statement was misleading. What I believe is a bug is Livecode's refusal to reopen the app, after it has been closed using the back button.

On my first card, I do not trap backKey. My app closes properly. Task manager assures me it is still open. That's okay. But when I try to open my app again, I just get a black screen. That's not okay.

Other people have had this same problem, and many have concluded that it is a bug.

Is that clear enough?
Dave

deebee
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 89
Joined: Mon Jul 19, 2010 6:59 am
Location: Illinois, USA

Re: Back key creates black screen

Post by deebee » Sat Oct 27, 2012 11:29 pm

Cool Dave wrote:If I hit the back key in my app, the app closes, but it is still open according to task manager.
Not a bug, I agree (EDIT: This IS a bug because as per the documentation, LiveCode closes the app when the backKey message is not captured by a handler). However I think this is where qberty may have stopped reading the post.
Cool Dave wrote:When I try to open it again, it just shows a black screen.
I'd agree this is a bug and I believe it is supposed to be fixed in 5.5.3. I haven't tried yet but maybe someone who has can confirm.

EDIT: Just tried it and it seems to be fixed in 5.5.3!

Post Reply

Return to “Android Deployment”