android-8.0-oreo

Webview crashes when displaying a youtube video

半世苍凉 提交于 2019-12-11 07:43:57
问题 After updating to 8.0 we get a crash so far we haven't seen before: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference at com.android.webview.chromium.WebViewContentsClientAdapter.getDefaultVideoPoster(WebViewContentsClientAdapter.java:536) at org.chromium.android_webview.DefaultVideoPosterRequestHandler$1.run(DefaultVideoPosterRequestHandler.java:2) at android.os.Handler.handleCallback(Handler.java:789) at

How does apps like Whatsapp or telegram listen to the incoming call/message events on Android?

≡放荡痞女 提交于 2019-12-11 07:05:40
问题 I built a VoIP calling app which maintains a persistent connection with the server to listen to any incoming calls. I implemented a background service to do this. But since Oreo, this running code is now broken because of the introduction of Background Execution Limits After looking into forums, I found that some people are suggesting Convert Service to JobService and let android schedule it Doing so, my app won't be able to receive calls when it is stopped Run your operations in foreground

How do I setMaskfilter without crash on Android O?

我只是一个虾纸丫 提交于 2019-12-11 02:34:23
问题 I use a RecyclerView in my grid. Each item has textview and Imageview. I set mask filter for textview in my Adapter as below: float[] direction = new float[]{0.0f, -1.0f, 0.5f}; MaskFilter maskFilter = new EmbossMaskFilter(direction, 0.8f, 15f, 1f); holder.textview.getPaint().setMaskFilter(maskFilter); It is the reason of crash ( Fatal signal 11 (SIGSEGV), code 1, fault addr 0xfff8022c in tid 32638 (ReferenceQueueD) ) for the firs time run. 回答1: This is known bug. Problem in method canvas

Android O device serial number from native

懵懂的女人 提交于 2019-12-10 22:53:33
问题 What is the proper way to get the serial number from native on Android O without calling the Java Build.getSerial() . On Android < 26 versions from native we could get the device serial number using the following code: string serial = read_property("ro.boot.serialno"); ... string read_property(const string& property_name) { char propertyValue[PROP_VALUE_MAX]; int propertyLen = __system_property_get(property_name.c_str(), propertyValue); ... } On Android O this throws an error: Access denied

Oreo: Alarm is not fired when Application is not running

纵饮孤独 提交于 2019-12-10 20:43:17
问题 I have relatively simple setup that should trigger an alarm at certain time of the day and show a notification to user. here is relative code, Setting the alarm long inTime = /*expirationTime*/ Calendar.getInstance().getTimeInMillis() + 10000; Intent startIntent = new Intent("parking.event"); startIntent.setClass(getBaseContext(), ParkingExpirationWarmingBroadcast.class); PendingIntent startPendingIntent = PendingIntent.getBroadcast(this, 99, startIntent, 0); alarmMgr.setExact(AlarmManager

notification.setOngoing(true) does not work in Android 8.1

会有一股神秘感。 提交于 2019-12-10 19:43:22
问题 build.setOngoing(true); build.setAutoCancel(false); notification.flags= Notification.FLAG_NO_CLEAR | Notification.FLAG_ONGOING_EVENT; setOngoing is not working if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { /* Create or update. */ _notificationChannel = new NotificationChannel("TubeMateGo", "Downlaod File Notification", NotificationManager.IMPORTANCE_DEFAULT); mNotifyManager.createNotificationChannel(_notificationChannel); build = new NotificationCompat.Builder(getBaseContext(),

Android Oreo (API26) and android.app.DownloadManager

妖精的绣舞 提交于 2019-12-10 19:28:27
问题 Folks! This code doesn't work on Android Oreo (but ok on older versions, I can see notifications and the DownloadManager.ACTION_DOWNLOAD_COMPLETE broadcast message). Kotlin testButton.setOnClickListener { val downloadManager = getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager val uri = Uri.parse("[url for a mp3 file]") val request = DownloadManager.Request(uri) request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI) request.setAllowedOverRoaming(false) request

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

Android Oreo (API 26) - Create dir in external storage

回眸只為那壹抹淺笑 提交于 2019-12-10 13:16:09
问题 I've been developing an app on nougat that creates a directory in the external storage. I used to do it like this: final File dir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Chords/Processed Audio"); dir.mkdirs(); This code does not seem to work on API 26 (Android Oreo). The directory is not created. How can I achieve the same thing, preferably that works on all android version from API 21 to API 26? 回答1: I have no problems running your existing code on a Nexus

java.lang.IllegalArgumentException: Failed to find configured root that contains

Deadly 提交于 2019-12-10 12:27:28
问题 This is my code block: notificationIntent.setDataAndType(FileProvider.getUriForFile( context, "TrySomething",new File(context.getFilesDir().getAbsolutePath() + "/update_file") ),ANDROID_PACKAGE); And this is my XML file: <?xml version="1.0" encoding="utf-8"?> <paths xmlns:android="http://schemas.android.com/apk/res/android"> <external-files-path name="myupdater" path="files/update_file"/> </paths> But i get this error: java.lang.IllegalArgumentException: Failed to find configured root that