back-button-control

How can I detect long pressed volume and power button when app is in background on Android P using service

空扰寡人 提交于 2020-01-06 05:47:15
问题 I want to detect volume button press when app is in background and even if device is locked I am working on android P, I was able to get long pressed volume button when app is in background but screen not locked using service and by getting Allow over other apps permission but it caused problem , when app is in background back button and keyboard are not working , I am able to open other apps like whatsapp but I can not type a message and can not back , Here is my code any please help .

android:back (device back button) event in Titanium not working

牧云@^-^@ 提交于 2020-01-01 03:16:09
问题 Hi i am working on android application development.I am using Titanium studio for development. I create a simple application.I want to capture the device back button event in my application because I don't want to user android default tabs in titanium.I am creating my own tabs.I tried following code : :list.js var expt = Titanium.UI.currentWindow; expt.addEventListener('android:back', function (e) { Ti.App.fireEvent('expt_back_event'); }); :app.js Ti.App.addEventListener('expt_back_event'

How to detect Hard/Soft back button on Android device?

不羁岁月 提交于 2019-12-23 18:46:24
问题 I want to know how to detect hard or soft "BACK Button" on device? I searched but mostly I found this code @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { // do something on back. return true; } return super.onKeyDown(keyCode, event); } But I just need to detect if there is BACK button exist on device or not in form of hard or soft. 回答1: I think this should work Queries the framework about whether any

Phonegap - navigator.app.backHistory() not working on HTML back button

血红的双手。 提交于 2019-12-17 06:41:26
问题 In my app i am using phonegap 2.6.For back button, I am using the following function document.addEventListener("backbutton", onBackKeyDown, false); function onBackKeyDown() { alert("hello"); navigator.app.backHistory(); } document.addEventListener('deviceready', onDeviceReady, true); The above function works fine when I click on the device's hardware back button . But when I click on the back button it is not working. I have designed my back button as below: <a class="ui-link" href="#" rel=

how to quit the application from my android device back button in Cordova?

我怕爱的太早我们不能终老 提交于 2019-12-12 00:47:23
问题 I am a new Cordova web Developer , I 'm creating an application that load automatically a web site using inapbrowser ,my probleme is : after loading the site when i click on the backbutton , instead of closing the application , it goes back to the blank page that contains the inapp browser , how to do to quit the application when i press the back button ?? 回答1: You can probably register a backbutton event on InAppBroswer page load and exit the app on click of back button. The sample code is

android:back (device back button) event in Titanium not working

江枫思渺然 提交于 2019-12-03 07:40:25
Hi i am working on android application development.I am using Titanium studio for development. I create a simple application.I want to capture the device back button event in my application because I don't want to user android default tabs in titanium.I am creating my own tabs.I tried following code : :list.js var expt = Titanium.UI.currentWindow; expt.addEventListener('android:back', function (e) { Ti.App.fireEvent('expt_back_event'); }); :app.js Ti.App.addEventListener('expt_back_event',function(e) { alert('hiiii in side event listener'); }); But its not working instead of giving pop-up it

How do I disable Android Back button on one page and change to exit button on every other page

吃可爱长大的小学妹 提交于 2019-11-29 05:55:39
I am developing an Android application using Phonegap that interacts with my Drupal site. I have re-assigned the Android "Back" button to prompt the user to log off from the Drupal server however, I just want it disabled on the login page (for obvious reasons). I can get it to work but only until the user logs out then once on the login page the button remains re-assigned as a logoff button. Here's the code I have so far: <head> <script> /* Wait until device is ready to re-assign Back button */ document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { document

How do I disable Android Back button on one page and change to exit button on every other page

寵の児 提交于 2019-11-27 17:39:02
问题 I am developing an Android application using Phonegap that interacts with my Drupal site. I have re-assigned the Android "Back" button to prompt the user to log off from the Drupal server however, I just want it disabled on the login page (for obvious reasons). I can get it to work but only until the user logs out then once on the login page the button remains re-assigned as a logoff button. Here's the code I have so far: <head> <script> /* Wait until device is ready to re-assign Back button

how to close android app completely

元气小坏坏 提交于 2019-11-27 12:52:45
I created an android application with a logout option in onCreateOptionsMenu . The Logout works perfectly but when I press the back button again it takes me to the previous activity, and when it gets a null value it redirects to login screen. Now my login screen appears again and again. I want to close the app completely when I press the back button but don't know how. Here is my code to handle the back button press in the login screen: @Override public void onBackPressed() { new AlertDialog.Builder(this) .setTitle("BidNEMO") .setMessage("Are you sure you want to exit?") .setNegativeButton

Phonegap - navigator.app.backHistory() not working on HTML back button

左心房为你撑大大i 提交于 2019-11-27 01:28:19
In my app i am using phonegap 2.6.For back button, I am using the following function document.addEventListener("backbutton", onBackKeyDown, false); function onBackKeyDown() { alert("hello"); navigator.app.backHistory(); } document.addEventListener('deviceready', onDeviceReady, true); The above function works fine when I click on the device's hardware back button . But when I click on the back button it is not working. I have designed my back button as below: <a class="ui-link" href="#" rel="external" onclick="onBackKeyDown()"> <img src="images/icon-back.png" alt="Phone" border="0"> </a> But