cordova-android-movetasktoback

0.1.4 • Public • Published

What is it?

This plugin exposes Activity::moveTaskToBack in cordova and thus allows to move the app to the back of the activity stack, effectively returning to the previous activity without terminating.

How to use it?

Installation

Install the plugin into your cordova project via

cordova plugin add cordova-android-movetasktoback

After installation the plugin exposes the method mayflower.moveTaskToBack.

API

Call mayflower.moveTaskToBack() to move the task to the back of the stack. Success or failure are returned as a Promises/A+ compliant promise.

mayflower.moveTaskToBack()
    .then(function() {
        console.log('success');
    })
    .otherwise(function(e) {
        console.log('failed: ' + e);
});

Important: This plugin is specific to android. On all other platforms, the call will fail and return a rejected promise.

Test / Usage sample

There is a small usage sample in test/index.html. In order to use it, you'll have to create a cordova project, add the plugin and configure test/index.html as your entrypoint. The resulting app will show you a periodically increasing counter and a button that returns to the launcher without terminating the app.

License

The plugin is published under the Apache license v2.0 .

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.4
    8
    • latest

Version History

Package Sidebar

Install

npm i cordova-android-movetasktoback

Weekly Downloads

8

Version

0.1.4

License

Apache 2.0

Last publish

Collaborators

  • christian.speckner