android-9.0-pie

Android Q: file.mkdirs() returns false

删除回忆录丶 提交于 2020-04-05 04:01:15
问题 We have an app that uses external storage to store some temporary files: images, binary data. The code for that has been working for a few years without big changes until recently. On Android Q it doesn't work: File f = new File(Environment.getExternalStorageDirectory().toString() + File.separator + MainActivity.APP_DIR) f.mkdirs(); // do sth with f The mkdirs now returns just false . Required permission is provided in the manifest: <uses-permission android:name="android.permission.WRITE

Need absolute file path of selected file using Intent.ACTION_OPEN_DOCUMENT in android pie

匆匆过客 提交于 2020-03-05 04:39:16
问题 I want to get pdf and convert it into base64. use this code to start picker Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); String [] mimeTypes = {"image/*", "application/pdf"}; intent.setType("*/*"); intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes); startActivityForResult(intent, 1); I had used below solution : https://stackoverflow.com/a/41440869/6864437 but it is not working on android pie getting below error: Request header queries do not support projections, selections or

Android 9 Http request are fail, Http Request given me error(500 internal serve error)

一世执手 提交于 2020-02-23 06:44:46
问题 With android 8 and lower http request are successful but with android 9 they are failing. I have tried to enable android:usesCleartextTraffic="true" in AndroidManifest.xml . I set networkSecurityConfig like suggested in the solution found here How to allow all Network connection types HTTP in Android (9) Pie? Try option - 1 *****AndroidManifest.Xml***** <uses-permission android:name="android.permission.INTERNET" /> <application ....... android:networkSecurityConfig="@xml/network_change

OnUnhandledKeyEventListener class not found

落爺英雄遲暮 提交于 2020-02-03 10:58:02
问题 I am having error on every support design widget. Like the recyclerview, coordinator layout etc. Everytime, I add a support design widget it is showing java.lang.ClassNotFoundException: android.view.View$OnUnhandledKeyEventListener on layout issue section. I'm using api 28.0.0-rc01, gradle 4.4 android 3.1.4. Here, is my build.gradle (app) file apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.example.android.test5test" minSdkVersion 23

OnUnhandledKeyEventListener class not found

青春壹個敷衍的年華 提交于 2020-02-03 10:54:31
问题 I am having error on every support design widget. Like the recyclerview, coordinator layout etc. Everytime, I add a support design widget it is showing java.lang.ClassNotFoundException: android.view.View$OnUnhandledKeyEventListener on layout issue section. I'm using api 28.0.0-rc01, gradle 4.4 android 3.1.4. Here, is my build.gradle (app) file apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.example.android.test5test" minSdkVersion 23

Failed to find target with hash string 'android-P'

不羁的心 提交于 2020-01-24 18:15:47
问题 I'm following this tutorial page and i get the exact same error that they say in that page Failed to find target with hash string 'android-P' in: D:\Development\Android\Sdk Install missing platform(s) and sync project when i click install missing platform(s) and sync project it shows the error as All packages are not available for download! The following packages are not available: - Package id platforms;android-P I have installed almost all the SDK it asks for ANDROID - P. 回答1: you're trying

Async task not supporting in android 9.0 (Pie)

Deadly 提交于 2020-01-21 05:26:47
问题 I was working on my code. it was working fine on version 8(Oreo) after that I got an update of android v 9.0 (Pie) and the app stopped working suddenly. after checking I got a error message om my Asyn task stating the below error: E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 Process: com.global.exch, PID: 25112 java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:354) at java.util.concurrent.FutureTask.finishCompletion

Room not creating database in UI-Tests

风格不统一 提交于 2020-01-16 01:08:10
问题 I am using a Room database inside my project and it works in production including the UI-Tests (with Espresso) until Android 8. On Android 9 currently my UI-Tests fail because the Database is not created. I get the following error message inside my logcat android.database.sqlite.SQLiteException: no such table: table (code 1 SQLITE_ERROR): , while compiling: SELECT * FROM table WHERE type = ? This only happens on Android 9 devices. While debugging with Stetho i can't find the db file aswell.

What is versionCodeMajor? And what is the difference with versionCode?

最后都变了- 提交于 2020-01-12 09:15:55
问题 I just found that PackageInfo.versionCode is deprecated in Android Pie. They point you to use PackageInfo.getLongVersionCode() instead. The JavaDoc of this new method is: Return versionCode and versionCodeMajor combined together as a single long value. The versionCodeMajor is placed in the upper 32 bits. But what is versionCodeMajor ? How must I use it? What's the difference between versionCodeMajor and the old versionCode ? The documentation of it say nearlly nothing: Internal major version

Android Notifications triggered by Alarm Manager not Firing when App is in Doze Mode

半腔热情 提交于 2020-01-12 04:00:20
问题 I have the following requirements. A user needs to be able to schedule a recurring reminder in my app that will trigger a push notification at an exact time every day. This is one of those questions that I hoped I would end up not submitting as similar questions were recommended while writing it. However several team members have spent hours and hours looking through the Android Developer Docs and Stackoverflow and we seem no closer to an answer, so here we are. If I create a reminder and set