Ways to intercept recent app (task manager button) on android 12 - android

I have tried intercepting the recent app button using one of the android lifecycle hook (onUserLeaveHint) and it has been working in android 11. After updating to android 12 due to the changes in behavior in launcher application that doesn't work anymore. I noticed that some mobile manager application are able to intercept the recent button.
Anybody can provide any insights on how to update my old launcher application to make it work on android 12.
Additional information: I am using a Samsung test phone, Thank You in advance.

Related

Why does geolocation stops working on Android Go after a deep clean?

The Cordova Geolocation plugin stops working on Android Go once the user does a deep clean on the device (clears all running apps).
I am building a Cordova app for Android that will be installed on multiple Blackview A20 mobile devices. The Blackview A20 devices runs a lite version of Android called Android Go. I am making use of the Cordova Geolocation plugin to track the device as the app is being used:
https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-geolocation/
All works as expected and the longitude/latitude values gets sent to our server for saving. But as soon as a user press on the "Running/Active apps" soft button of the device and then press on the (X) button to close all running apps and clean the device memory and then run the app again, then the Geolocation plugin returns 0 for both longitude and latitude. The only way to fix this as far as I experienced is to restart the device itself, which is not a solution.
On the same device if you run the Google Maps Go app, the issue does not seem to occur as the Google Maps Go app still tracks the device as I move around. This could be due to the Google Maps Go app that might be a native Android app versus the hybrid Android app that I am building. Also the same app that I am building does not give the same issue on other devices (tested on a Blackview BV8000 Pro running Android 7.0 as well as a Samsung Galaxy S5 running Android 5.0). I tried button mapping apps to try prevent the users from pressing the Running/Active apps button but it still does not fix the issue at hand. I also tried multiple third party plugins to track Geolocation but same issue occurs.
I am not sure if this issue could be due to Android Go, Cordova Geolocation plugin or the Blackview A20 device. Any help appreciated.
navigator.geolocation.getCurrentPosition(onLocationFound, onLocationError, {"timeout":TIMEOUT_GEO_LOCATION});
If I understood correctly; when you make deep clean, you have to take permissions from user again or go app settings and check permissions panel and toggle location permission manually.

Force close within Android Wear component

My app has been working quite happily with Android Wear support for the last two years or so. Following an update to Android Webview, I'm getting force closes in some circumstances when running my app. The force close is within the Android Wear component though. My software hasn't changed (and I don't think I'm using a Webview at all, though Wear may be I suppose). I'm not really sure how to go about debugging this, other than keep on reporting the issue via Android and wait for Google to fix it (if indeed the bug is within Android Wear or Android Webview itself). Here's the stack trace. Does anyone have any ideas what's causing it please? Any help gratefully received.

Android app process not killed after removed from recent app list

I found my app's process is not killed after I swipe away from recently used app list, but only happen on LG nexus 5 with Android OS 6.0.1 (from devices I've tested), the process is killed cleanly on other devices.
I've integrated a third party sdk which would start other processes and services if I init it and I'm sure it's related because if I don't init it, the problem disappears, but I'm not clear how and what flags the third party uses when creating those services.
So my question is, is there any known bugs or system-wise settings I'm missing that cause this behaves differently in different devices or OS?
Apps are not stopped completely if you swipe the app off the Recent App list. I think services are kept alive if you do this. If you're using a third party then it starts a service for its tasks, then that must be it.

Android app restarts after device language has changed

I'm working on a Android app that supports several languages. When I put it in background, change device language and then resume the app, it restarts and it seems like the Android system destroys it after changing device language. Do you know if this is what happens? If not, it's certainly regarded to my code, but I don't really know if Android system behaves this way. I've tested on devices with Android 4.3, 4.4, 4.0 versions. On 4.0 it doesn't happen always.
I would like to avoid the app restart, as I don't need to also change the app language along with the device's.
Thank you in advance.

Launching the android stopwatch from my app

I want to launch the stopwatch application that comes with android from my app but have no idea how to do this.
I do not want to create a stopwatch on my own since it needs to keep running when I close my app.
Up until Android 4.1 (or maybe 4.2) AOSP Android did not have a stop watch in it, and there is no official SDK support for launching that part of the app. Stopwatches are likely installed by the user or the OEM on the majority of devices.

Categories

Resources