android-8.1-oreo

Background service is not working in Oreo

旧巷老猫 提交于 2020-01-09 07:06:08
问题 I want to run my app in background if I kill the app instance also. But after I kill my app the service also stops working. Here is my code please any one help me to solve my issue. I followed this link for running in the background but it is not working if I remove the instance. Please can any one show me how to run a background service if the instance is removed also? This is my MainActivity @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Notifications fail to display in Android Oreo (API 26)

家住魔仙堡 提交于 2020-01-09 02:14:11
问题 I get this message when trying to display a notification on Android O. Use of stream types is deprecated for operations other than volume control The notification is straight from the example docs, and displays fine on Android 25. 回答1: Per the comments on this Google+ post: those [warnings] are currently expected when using NotificationCompat on Android O devices ( NotificationCompat always calls setSound() even if you never pass in custom sound). until the Support Library changes their code

Unable to open PDF from internal storage for viewing on Android 8 and 9 using File Provider

徘徊边缘 提交于 2020-01-06 04:36:30
问题 For Android 8 and 9 only. I have a PDF filer here - String url = "file:///storage/emulated/0/Android/data/com.verna.poc/files/Download/mypdf.pdf"; I'm trying to open this file for viewing using this - File file= new File(url); file.setReadable(true, false); Intent intent = new Intent(Intent.ACTION_VIEW); Uri pdfUri = FileProvider.getUriForFile(getApplicationContext(), BuildConfig.APPLICATION_ID + ".provider", file); intent.setDataAndType(pdfUri, "application/pdf"); intent.addFlags(Intent.FLAG

Registering Static Broadcast receiver in Oreo

懵懂的女人 提交于 2020-01-03 16:00:08
问题 I'm Working on a project which records incoming calls and outgoing calls, but with Oreo static broadcast receivers (Broadcast receivers which are registered in the manifest) are not getting triggered. if I register with context, the broadcast will not be triggered once app gets killed. I want the broadcast receiver to work even if app is closed. is there any possible way to achieve this Oreo? or any other alternative approach to achieve this? any help will be appreciated. I'm registering in

How to have Read + Write external storage after targeting android O (26) 8.0

白昼怎懂夜的黑 提交于 2020-01-02 05:23:16
问题 Before targetting android O code below worked perfectly. After setting targetApi=27 (8.1) this stopped working. context.requestPermissions(new String[]{ Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, requestCode); I am presented with a permission dialog we all know, I gladly allow App to access photos media and files on a device. and in onRequestPermissionResult() it returns android.permission.READ_EXTERNAL_STORAGE == 0, android.permission.WRITE

Toasts overlap issue on Oreo (8.1)

拜拜、爱过 提交于 2019-12-30 04:23:11
问题 I have a problem with toasts. For API 26 and below toasts are displayed properly (next toast is waiting for previous to disappear) but on Android 8.1 (API 27) they are covering each other. I have notification channel set up like this: if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { NotificationChannel notificationChannel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, NOTIFICATION_CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT); notificationManager

ForegroundService on android Oreo gets killed

强颜欢笑 提交于 2019-12-29 08:24:32
问题 I'm trying to build up a service which requests the device location every minute. I need this to work in background even when the application is closed. So far I managed to make it work on devices which has a pre-Oreo android OS but now I'm testing the service on android Oreo device and is not working when I close or put the application in background. In my research I found that for Oreo devices a Foreground Service with an ongoing notification should be used to achieve this so to start with

ForegroundService on android Oreo gets killed

烈酒焚心 提交于 2019-12-29 08:24:11
问题 I'm trying to build up a service which requests the device location every minute. I need this to work in background even when the application is closed. So far I managed to make it work on devices which has a pre-Oreo android OS but now I'm testing the service on android Oreo device and is not working when I close or put the application in background. In my research I found that for Oreo devices a Foreground Service with an ongoing notification should be used to achieve this so to start with

Failed to fire broadcast receiver in Android Oreo

余生长醉 提交于 2019-12-24 05:52:44
问题 Using SyncAdapter and AbstractThreadedSyncAdapter https://riptutorial.com/android/example/32303/sync-adapter-with-every-min-requesting-value-from-server- I have registered receiver in manifest and from SyncAdapter broadcast register its working fine before Oreo but in Oreo, broadcast receiver failed to fire. Intent intent = new Intent(); intent.setAction("package.qa.ACTION_SYNC"); intent.putExtra("OUTBOX_ID", outboxId); intent.putExtra("JSON_RESPONSE", jsonResponse); intent.putExtra("TRANS

App crashes with java.lang.UnsatisfiedLinkError for Oreo devices with Xamarin.Android

倖福魔咒の 提交于 2019-12-23 05:14:00
问题 I'm receiving crash reports in Google Play Console for my app, and the stacktrace is as follows: java.lang.UnsatisfiedLinkError: at mono.android.Runtime.register (Native Method) at md5f3dc63ecaad575af71bd7a9b1622f75b.n.<clinit> (n.java:20) at java.lang.Class.newInstance (Native Method) at android.app.ActivityThread.handleCreateBackupAgent (ActivityThread.java:3431) at android.app.ActivityThread.-wrap3 (Unknown Source) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1813) at