Apps with changed icon color won't launch
Some apps like "Tasks.org", "Simple Contacts" or "Simple Calendar" give users the ability to change the color of the app's icon in settings. Pie launcher can only launch these apps if their icon color is kept on the default color, or else it will only play the launch animation but won't launch the app, forcing one to launch these apps in some other way.
Thanks a lot for reporting! 👍 I wasn't aware of this bug.
Hm, somehow I cannot reproduce this bug 🤔 I tried Tasks.org, changed the launcher icon color in the settings and was able to launch the app as before. I could not try Simple Contacts or Calendar as the feature is behind a pay wall there.
Can you please confirm that Tasks.org does not work on your device with a different icon color?
I have multiple Fossify Apps (fork of Simple Apps) installed and have custom color set to every one of them and I can launch the apps without problem (from pie menu and from apps menu as well...)
Okay, if it works for both of you then the problem could be my device - it runs MIUI 11 / Android 10.
I get both "Tasks.org" and "Simple Mobile Tools" from F-Droid. After seeing your comments I also tested "Fossify Apps" from both the Play Store and from F-Droid but they all behave in exactly the same way: On the default icon color all apps launch, when changed to a non-default color only the launch animation plays, and when changed back to the default color all apps launch again.
Is there any way for me to give you some kind of technical bug report? I don't know what else would help when you can't reproduce the bug.
Well, you could check the device logs when this is happening with logcat, if you have the adb command line tool (from the Android SDK, then read here how to check the logs) or Android Studio installed (then follow this guide). Hopefully there's an error message when launching an affected app fails.
Then, if you like, and if you're curious enough, you could also clone this repository and build and run the app from source on your device with Android Studio. It's really quite easy to do. Check this YouTube guide for example. The app is built and installed in a debug version so it can be easily installed beside the production app.
Then, this code snippet launches apps in Pie Launcher. You could remove the try/catch block to see (in the logs) if there are any exceptions (which would crash the app).
I have the same problem with com.textra.
I tried what you said, and there is no exception thrown by the snippet you given.
However, if I put startMainActivity out of the if (lm.isActivityEnabled(icon.componentName, icon.userHandle)), the app launches just fine.
And here is more info:
-
icon.componentName.toString()isComponentInfo{com.textra/com.mplus.lib.Main_ff2e7d32}(looks strange?), -
icon.componentName.getPackageName()iscom.textra -
icon.userHandle.toString()isUserHandle{0}
Hello again @markusfisch, I think I have a clue what causes the bug. It seems that this check doesn't pass when it should, because icon.componentName is not the expected value due to the changed color of the app. However, if I replace isActivityEnabled with isPackageEnabled, the app is launched, but I can't test completely if it works as intended because my device doesn't support multiple user profiles.
@Sergueille Good catch! This may indeed be the reason! I'm currently reworking this section.
Fixed in https://github.com/markusfisch/PieLauncher/commit/f592a224f3ba340c00eb7f8fd1bfcba6065ac16e
Version 1.23.6 is on it's way through Google Play and should become available shortly.
I tested it on 1.23.6, and it still doesn't work (tested with Textra and Fossify Keyboard). For both apps I now see the toast that says "Activity not enabled". I'll try to investigate further tomorrow...
Sorry that it didn't work, and thanks a lot for reporting that the bug still exists. Very much appreciated!
At least the new Activity not enabled message helps to narrow the problem down.
When the color is changed, icon.componentName looks like "app.mainActivity.color", and the only activity returned by launcherApps.getActivityList is this activity. Then, launcherApps.isActivityEnabled returns false and the toast is shown.
I don't quite understand why these check are being made, would it be more reliable to instead launch the activity directly and then catch exceptions?
Good point! Currently isActivityEnabled is used to find an enabled activity if the original one got disabled. But that doesn't seem to work as expected, so catching the exception may also be a good approach. Will try.