Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(android): add moveToBackground method #14009

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -328,6 +328,11 @@ public String harmonizedColor(String value)
return String.format("#%06X",
(0xFFFFFF & MaterialColors.harmonizeWithPrimary(TiApplication.getAppCurrentActivity(), color)));
}
@Kroll.method
public void moveToBackground()
{
TiApplication.getAppRootOrCurrentActivity().moveTaskToBack(true);
}

@Override
public String getApiName()
Expand Down
5 changes: 5 additions & 0 deletions apidoc/Titanium/UI/Android/Android.yml
Expand Up @@ -29,6 +29,11 @@ methods:
type: String
since: { android: "12.0.0" }

- name: moveToBackground
summary: Moves the app to the background
platforms: [android]
since: { android: "12.4.0" }

- name: hideSoftKeyboard
summary: |
Hides the soft keyboard.
Expand Down