android-9.0-pie

Android 9 API 28 ONLY WebView is showing a black pop up in some devices

夙愿已清 提交于 2019-12-11 07:46:38
问题 I have been trying to figure out why one of the pop-ups inside a webview is showing a black screen in some devices. please see attach The URL works as URI but not inside the webview. note: it seems the url have javascript issues. not sure why android 9 block its content [chromium] [INFO:CONSOLE(3)] "Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080", source: https://mylink.com/js/libs

Retrofit2 response null on android pie

限于喜欢 提交于 2019-12-11 06:57:36
问题 On android pie i am getting null response for retrofit2 request. Same code is working on all previous android devices. i have added android:usesCleartextTraffic="true" in manifest its fixed the issue of http connection but i am not getting response as expected in all other androided version the response is expected but not in pie. so please help thanks in advance Manifest.xml <application android:allowBackup="false" tools:replace="android:allowBackup" android:icon="@mipmap/cabad_logo_new"

Starting activity from Service when phone is locked Android 9.0(Pie)

烈酒焚心 提交于 2019-12-11 06:07:34
问题 Hello I'm working on VoIP feature for the app and I'm trying to handle cases when app is killed. My idea is to go with FCM notification and run activity which will show user incoming call screen. It works as expected when phone is unlocked but not the case when phone is locked. I tried this : if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O_MR1) { setShowWhenLocked(true); setTurnScreenOn(true); }else{ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); getWindow()

App not installed after upgrading to Android - P

耗尽温柔 提交于 2019-12-11 04:05:02
问题 App is installing while connecting via USB to mobile, but while sending .apk file to others it saying "App not Installed"(both debug and release).I have tried different solutions from stackoverflow but none worked for me. 1.How to overcome app not installed error when building from Android Studio 3.0? 2.Cannot install signed apk to device manually, got error "App not installed" 3.Android Studio 3.0 Unsigned Apk Not Installing Below is my build.gradle(app level) android { compileSdkVersion

Detect when app is killed from recent apps list in android O and P

我是研究僧i 提交于 2019-12-10 17:42:28
问题 Use case is I have to send logout request to server when app get killed from recent lists. I use onTaskRemoved to handle that however in Android O and P I get notification bar saying "app is running" that I want to avoid. Here is how I run foreground service: if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); channelId = "my_service_channel_id"; String

How to display menu item Icons on Android 9 in Floating Action Mode

亡梦爱人 提交于 2019-12-10 15:57:08
问题 I have an Android menu XML that resembles this:- <item android:id="@+id/action_share" android:orderInCategory="100" android:icon="@drawable/ic_social_share" app:showAsAction="always" android:title="" /> <item android:id="@+id/action_something_else" android:orderInCategory="200" android:icon="@drawable/ic_airplanemode_active_black_24dp" app:showAsAction="always" android:title="" /> My Android code resembles this:- private void startActionMode() { startActionMode(new android.view.ActionMode

How can we get the size of screen with notch on the top

别说谁变了你拦得住时间么 提交于 2019-12-10 15:48:35
问题 There are some devices such as Huawei p20(running android 8,8.1) which has in-built notch on the top. The current way to get the size of the screen is Display display = getWindow().getWindowManager().getDefaultDisplay(); Point screenSize = new Point(); display.getRealSize(screenSize); //screenSize.x //screenSize.y And it's leading the game out of screen. So, is there any way to solve notch issue with android P and Pre-p devices. 回答1: There are only few android devices with notch options and

How to create an Object with private creator (like EGLContext) under PIE?

耗尽温柔 提交于 2019-12-10 14:55:25
问题 This class is defined under Android: public abstract class EGLObjectHandle { private final long mHandle; protected EGLObjectHandle(long handle) { mHandle = handle; } public long getNativeHandle() { return mHandle; } } and also public class EGLContext extends EGLObjectHandle { private EGLContext(long handle) { super(handle); } } now my problem is that I want to create an EGLContext with my handle. How to do this? before I do it with the function below but it's not working anymore on PIE

How to handle notch(display cutout) in android API lower than 28?

风流意气都作罢 提交于 2019-12-10 12:34:19
问题 Android added notch support on API 28, but how to handle it on devices running API 27 (Honor 10, Huawei P20, etc.) ? I was trying to use DisplayCutoutCompat but I was not able to create an instance of it since documentation does not really point out how create one. How to create the constructor parameter values: Rect safeInsets , List<Rect> boundingRects ? I also looked into the source code of the constructor, which is a bit confusing to me: public DisplayCutoutCompat(Rect safeInsets, List

SQLite: No Such Table Error Android P problem

旧巷老猫 提交于 2019-12-10 05:10:34
问题 Until Android P everything worked fine with my code but now in Android P I'm having a lot of problems working with databases. I have .db sqlite database files stored on assets folder. I was importing them into the database space of android and it worked fine until Android P. In android P I'm getting this exception: SQLite: No Such Table Error I searched here and found this, and I tryed to apply the accepted answer: Android P - 'SQLite: No Such Table Error' after copying database from assets