events - Nativescript Android physical back button override? -


how can override android physical button can make own code on it's event. i'm using newest nativescript.

you can try this:

var applicationmodule = require("application"); var androidapplication = applicationmodule.android;     var activity = androidapplication.startactivity || androidapplication.foregroundactivity || topmost().android.currentactivity || topmost().android.activity; activity.onbackpressed = () => {    //your code here }; 

Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -