android-recents

Android Lollipop know if app as Usage Stats access

非 Y 不嫁゛ 提交于 2019-12-09 11:35:45
问题 Since Android Lollipop, we have now an API for accessing apps usage stats. However, your app must be granted those permissions by the user. I know that for redirecting the user to those settings using Settings.ACTION_USAGE_ACCESS_SETTINGS. Now, my question is how do you know the user has granted you those permissions so that you can stop redirecting him to the settings. Thanks! 回答1: you can simply query usagestats with daily interval and end time the current time and if nothing is returned

how to keep multiple activities of the same app in the recent-apps list

最后都变了- 提交于 2019-12-09 03:09:16
问题 I have one app with two activities A & B, both with launch mode singleInstance. I notice that even if both A and B are running in the background, only the last activity is shown in recent-apps list. Is it possible to keep both A & B in the recent-apps list? Thanks. 回答1: In the AndroidManifest, make sure to set the android:taskAffinity attribute of the element differently for each Activity. For example: <activity android:name="com.example.ActivityA" android:label="Activity A" android

Android resume app from recent applications list

对着背影说爱祢 提交于 2019-12-06 14:27:57
问题 I am trying to fix a bug in my code, and am hoping someone can point me in the right direction. If my app goes into the background, and gets resumed by the user just going into "apps" and selecting my app, everything works fine. However, if they put it into the background and resume it by holding down the home button, and selecting it from the recent apps list, I get a bug. I was under the impression these two actions should do the exact same thing? Does anyone know what the difference is

Is it safe to disable com.android.systemui?

不打扰是莪最后的温柔 提交于 2019-12-06 04:30:26
问题 I have found that Android recent app dialog can be disabled by disabling package com.android.systemui . I want to run my (rooted) device in kiosk mode so it is essential that the recent apps dialog not be shown on long press. Now, exactly what does com.android.systemui do? I don't need notifications and power indicators and stuff so it is OK if that kind of cosmetic stuff disappears. It is also OK if soft input home buttons disappear because I have replaced them with a software app (Button

Handle app closing event from Launcher's menu

喜欢而已 提交于 2019-12-05 21:15:06
What I want to do is to know when user closes the app from Android Launcher's menu, which gets opened on home button long click: I want to do some operations when user closes the app. Actually, I want user to logout each time he leaves the app, but as long as he can close app in this was too, I have to handle this event and then make my operations. I've tried to google this one, but I couldn't find anything considering this. I don't want to override onStop() or onDestroy(), as long as the user may come back to the app then, in that case I don't have to make my changes. Don't advice this. I

Android resume app from recent applications list

折月煮酒 提交于 2019-12-04 20:16:10
I am trying to fix a bug in my code, and am hoping someone can point me in the right direction. If my app goes into the background, and gets resumed by the user just going into "apps" and selecting my app, everything works fine. However, if they put it into the background and resume it by holding down the home button, and selecting it from the recent apps list, I get a bug. I was under the impression these two actions should do the exact same thing? Does anyone know what the difference is between resuming an app from the normal list of apps, vs resuming it by holding the home button down and

Is it safe to disable com.android.systemui?

谁说我不能喝 提交于 2019-12-04 10:05:57
I have found that Android recent app dialog can be disabled by disabling package com.android.systemui . I want to run my (rooted) device in kiosk mode so it is essential that the recent apps dialog not be shown on long press. Now, exactly what does com.android.systemui do? I don't need notifications and power indicators and stuff so it is OK if that kind of cosmetic stuff disappears. It is also OK if soft input home buttons disappear because I have replaced them with a software app (Button saviour). Is it safe to disable com.android.systemui , or do I risk subtle system hangs in certain

How to exclude from recents an exported activity?

倖福魔咒の 提交于 2019-12-04 07:27:21
I have an app with an exported activity that can be invoked from other apps (Specifically the sharing action - android.intent.action.SEND ) How can an exported activity be excluded from recents? I don't see a way to set the FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS flag, because it is invoked from the outside. The reason I want to do this is because this intent becomes the last one in my activity stack, thus when clicking on the recents, a file is being re-shared instead of the main activity to pop up. Note : android:launchMode="singleTask" solves the problem in a specific case, only where another

Android use a different icon for recent apps

倖福魔咒の 提交于 2019-12-04 01:28:28
问题 I have a working app but I want to add an alternate version of the app's icon that would be associated with the recent apps window. Instead of the icon that appears on the homescreen, the recent apps window would use the other one. 回答1: The way this can be done is using the new setTaskDescription(...) method in the Activity class. It can be used to set the title of the task and the icon of the task to display in the recent apps screen. This uses the ActivityManager.TaskDescription class to

Android Lollipop know if app as Usage Stats access

♀尐吖头ヾ 提交于 2019-12-03 14:07:28
Since Android Lollipop, we have now an API for accessing apps usage stats. However, your app must be granted those permissions by the user. I know that for redirecting the user to those settings using Settings.ACTION_USAGE_ACCESS_SETTINGS. Now, my question is how do you know the user has granted you those permissions so that you can stop redirecting him to the settings. Thanks! tzanou you can simply query usagestats with daily interval and end time the current time and if nothing is returned this means the user hasn’t granted permissions @TargetApi(Build.VERSION_CODES.LOLLIPOP) public boolean