android-8.0-oreo

android.graphics.drawable.AdaptiveIconDrawable cannot be cast to android.graphics.drawable.BitmapDrawable error

醉酒当歌 提交于 2019-12-06 05:19:27
问题 I'm getting this error when trying to implement Adaptive Icons while my app crashes on startup. I can't imagine why I'm getting this error because in the files mentioned in the error log below ( MainActivity and BaseActivity ), I don't use both AdaptiveIconDrawable and BitmapDrawable . 2018-04-28 16:50:17.014 31282-31282/de.markustippner.wondermusic2 E/AndroidRuntime: FATAL EXCEPTION: main Process: de.markustippner.wondermusic2, PID: 31282 java.lang.RuntimeException: Unable to start activity

Android O can't receive broadcast Intent.ACTION_NEW_OUTGOING_CALL

ぐ巨炮叔叔 提交于 2019-12-06 01:37:12
In my application, I can receive android.intent.action.PHONE_STATE but can't receive Intent.ACTION_NEW_OUTGOING_CALL on android O . If I use android N or android M everything work fine. I have register first broadcast in AndroidManifest file and second in foreground service , but none of them can receive Intent.ACTION_NEW_OUTGOING_CALL , only can receive android.intent.action.PHONE_STATE . If anyone know how to fix it, please post your answer, thanks in advance. Arnav M. But I am still confused, because my phone not ask me to give the permission but work fine. Maybe a bug or feature of android

Oreo: startService() doesn't throw IllegalStateException when called in background

时间秒杀一切 提交于 2019-12-05 20:29:51
According to the background execution limits introduced in Android Oreo, calling startService when the app is in background should throw an IllegalArgumentException . Check this question: Android 8.0: java.lang.IllegalStateException: Not allowed to start service Intent . I created a sample app targetting Android Oreo that does the following: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); new Handler().postDelayed(new Runnable() { @Override public void run() { startService(new Intent(MainActivity.this,

Error:Execution failed for task ':app:processDebugResources' when using font folder inside res

我的未来我决定 提交于 2019-12-05 16:43:42
I have updated SDK to Android O developer preview and started a simple demo with single TextView. When i included font inside res folder it started showing me Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.ProcessException: Failed to execute aapt Here is my build.gradle android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { ... minSdkVersion 15 targetSdkVersion 25 } } Note : I am using Android Studio 2.4 Preview 3 If i remove font folder from res , everything works fine This setup worked for me: compileSdkVersion 'android-O'

Invalid UUID of storage gained from Android StorageManager?

谁说胖子不能爱 提交于 2019-12-05 16:27:17
I lost whole day fighting with something trivial, but now I just give up and need your help. In new Oreo API for reading app code/data/cache/ size we need storage UUID ( StorageStatsManager.queryStatsForUid(UUID storageUuid, int uid) ). The storage UUID is possible to fetch from StorageManager.getStorageVolumes() which returns list of all storages which contains also the UUIDs. And there the problem begins: The UUID from returned list is in String format while StorageStatsManager.queryStatsForUid(UUID storageUuid, int uid) requires UUID object - nothing simplier - there exist method UUID

Launch APK Installer Oreo

守給你的承諾、 提交于 2019-12-05 12:18:35
I have had this code working for some time now but with Android Orea it doesn't work. Context context = mContextRef.get(); if (context == null) { return; } // Get the update String filepath = getDownloadLocation(); File apkFile = new File(filepath); Uri fileLoc; Intent intent; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { intent = new Intent(Intent.ACTION_INSTALL_PACKAGE); fileLoc = android.support.v4.content.FileProvider.getUriForFile(context, mFileProviderAuthority, apkFile); } else { intent = new Intent(Intent.ACTION_VIEW); fileLoc = Uri.fromFile(apkFile); } intent.setDataAndType

How to change notification sound dynamically in Android O

情到浓时终转凉″ 提交于 2019-12-05 11:14:54
Recently I use notification channel to support android O. But the problem is I cannot change the sound Uri dynamically. Our app have notification sound setting which user can change app notification sound as they want. But as you know, Android now do not allow developer to update notification channel before user reinstall app. There I consider several possible solutions which is not looks good. User ringtone manager to play ringtone instead of setSound. But when user disable notification in app setting, still ringtone will not stop playing. (This will be bad user experience) Delete

How register Broadcast Receiver for media button in Oreo?

夙愿已清 提交于 2019-12-05 07:42:04
I have a problem with the new Android version, that is 8.0 (Oreo). I have to register a broadcast and I do this with this code: // android.intent.action.MEDIA_BUTTON IntentFilter filter = new IntentFilter(Intent.ACTION_MEDIA_BUTTON); r = new MediaButtonIntentReceiver(); // this line sets receiver priority filter.setPriority(999); registerReceiver(r, filter); This works on older Android version but on Android 8 this doesn't work because it is necessary register explicit broadcast but I don't know how. How can I register explicit broadcast to detect media button? This is in Manifest.xml:

Is android.intent.action.DOWNLOAD_COMPLETE an explicit broadcast?

吃可爱长大的小学妹 提交于 2019-12-05 07:35:56
My app (targetSdk=25) has a broadcast receiver defined in the manifest as follows: <receiver android:name="my.package.DownloadManagerReceiver" android:exported="true"> <intent-filter> <action android:name="android.intent.action.DOWNLOAD_COMPLETE" /> </intent-filter> </receiver> My DownloadManagerReceiver is notified whenever Android's DownloadManager finishes downloading a file, so I can do some processing on the file that was downloaded. I'm working on migrating my app's targetSdk to 27 (Oreo). According to https://developer.android.com/about/versions/oreo/background#broadcasts , implicit

How to overlay a layout on lock screen when in devices running Oreo and Pie

被刻印的时光 ゝ 提交于 2019-12-05 07:30:35
In my application i'm trying to overlay a layout with a service here when i'm running service it successfully executes and display the layout on lock screen when target devices is lower than oreo but when i'm trying to overlay the same from versions later than oreo it's not working however when i change the flag to Type_Application_Overlay as suggested in other answers it just display layout when screen is unlocked but i want to show it over lock screen i tried searching a lot but didn't find any helpful answers to solving this problem some answers suggested displaying an activity over