Skip to content

snoop31/cordova-plugin-KillApp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova KillApp Plugin

Simple plugin that lets you exit or restart an android process using android.os.Process.killProcess(android.os.Process.myPid());. Restarts happen using PendingIntent.

Useful where navigator.app.exitApp(); might not work. Also useful if your app needs to reset and start from the Initial Activity.

Usage

1. Create a new Cordova Project

$ cordova create hello com.example.helloapp Hello

2. Install the plugin

$ cd hello
$ cordova plugin add https://github.com/srivathsa-dhanraj/cordova-plugin-KillApp

3. HTML

Edit www/index.html and add the following code inside <HEAD></HEAD>

<script type="text/javascript" src="KillApp.js"></script>

4. Javascript

KillApp.killProcess(1); //Pass 1 to restart. 0 (optional) to exit. 

About

Cordova ability to kill and restart Process

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 89.0%
  • JavaScript 11.0%