Quantcast
Channel: Delphi Forum - Delphi Programming Kings of Code - Delphi Programming
Viewing all articles
Browse latest Browse all 173

Minimize APP in Android

$
0
0
Hi there:

I want so start an aap and inmediately I want to send it to the background, like the home button does.

I have tried:

form1.SendToBack;
form1.Active := false;
form1.Hide;
form1.DoHide;
WindowState := TwindowState.wsMinimized;

and no one works.

I do noy want the user knows that the App has started. So the form transparency is set to true, no elements are visible on the form. The only need of this app is to start a service.

So the app starts, and I see the screen on black color...and nothing happens until I press home button. So the black screen is there forever if I do not press the home button  or back button.

How can I send the app to the background "by code".

Thanks in advance.

I managed to do it,

This is the code;

procedure TForm1.ButtonHome;
var
  Intent: JIntent;
begin
  Intent := TJIntent.Create;
  Intent.setAction(TJIntent.JavaClass.ACTION_MAIN);
  Intent.addCategory(TJIntent.JavaClass.CATEGORY_HOME);
  MainActivity.startActivity(Intent);
end;
 

Viewing all articles
Browse latest Browse all 173

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>