Closed danimahardhika closed 6 years ago
Sure, you can do this:
final Intent intent = new Intent("com.android.launcher3.FLICK_ICON_PACK_APPLIER");
intent.setPackage("com.android.launcher3");
intent.putExtra("com.android.launcher3.extra.ICON_THEME_PACKAGE", context.getPackageName());
context.startActivity(intent);
If you send me an APK I can test this!
It doesn't work
android.content.ActivityNotFoundException: No Activity found to handle Intent {
act=com.android.launcher3.FLICK_ICON_PACK_APPLIER flg=0x10000000 pkg=com.android.launcher3 (has extras)
...
If it's a receiver, I think you should register it first inside manifest
Yes, I mean this is not implemented yes, but you can do that on your app, than pass me APK and I test it with my code (which is not released)
Check here. I only added 1 icon for Chrome.
Candy app tell me Launcher is not installed (in installed section WTF?)...and open Google Play..
I told you before, it doesn't works. You need to register the receiver inside flick launcher manifest.
I've do that!..see screenshot
This is the packagename I used to check if Flick launcher installed
com.universallauncher.universallauncher
I used this code to apply from the dashboard
final Intent flick = new Intent("com.android.launcher3.FLICK_ICON_PACK_APPLIER");
flick.setPackage("com.android.launcher3");
flick.putExtra("com.android.launcher3.extra.ICON_THEME_PACKAGE", context.getPackageName());
flick.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(flick);
((Activity) context).finish();
Then this exception shown right after context.startActivity(flick)
called
android.content.ActivityNotFoundException: No Activity found to handle Intent {
act=com.android.launcher3.FLICK_ICON_PACK_APPLIER flg=0x10000000 pkg=com.android.launcher3 (has extras)
Seems correct, but I don't understand wht it tell me "Flick Launcher is not installed" I've also tried with signed apk..
So?? @danimahardhika
Already follow your guide above, but not working.
Bro, you don't understand...Your apk doesn't work with my code (not updated in github, it's my private code!)
I'm just following your guide. Nova launcher has similar code to apply icon pack and it works.
What's the package name of flick launcher? Is it this one
com.universallauncher.universallauncher
Yes but problem is that your apk doesn't give me access to Flick Launcher, it is showed in installed apps but when I click it tell me "Flick Launcher is not installed" so it redirect me in Play store and..Flick launcher is installed..WTF?
Yes it is correct package!
Should I explain to you one more time?!
This is the packagename I used to check if Flick launcher installed
com.universallauncher.universallauncher
I used this code to apply from the dashboard
final Intent flick = new Intent("com.android.launcher3.FLICK_ICON_PACK_APPLIER");
flick.setPackage("com.android.launcher3");
flick.putExtra("com.android.launcher3.extra.ICON_THEME_PACKAGE", context.getPackageName());
flick.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(flick);
((Activity) context).finish();
Then this exception shown right after context.startActivity(flick)
called
android.content.ActivityNotFoundException: No Activity found to handle Intent {
act=com.android.launcher3.FLICK_ICON_PACK_APPLIER flg=0x10000000 pkg=com.android.launcher3 (has extras)
try {
final Intent flick = new Intent("com.android.launcher3.FLICK_ICON_PACK_APPLIER");
flick.setPackage("com.android.launcher3");
flick.putExtra("com.android.launcher3.extra.ICON_THEME_PACKAGE", context.getPackageName());
flick.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(flick);
((AppCompatActivity) context).finish();
} catch (ActivityNotFoundException e) {
//When the exception called, that means the launcher not installed, there will be a popup dialog to ask if user want to install the launcher from play store
openGooglePlay(context, launcherPackage, launcherName);
}
The problem comes from your side, not mine
I tried to change the code like this, since I can't test it by myself, I don't know if it's working or not. Check here
final Intent flick = new Intent("com.android.launcher3.FLICK_ICON_PACK_APPLIER");
//before com.android.launcher3
flick.setPackage("com.universallauncher.universallauncher");
flick.putExtra("com.android.launcher3.extra.ICON_THEME_PACKAGE", context.getPackageName());
flick.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(flick);
((AppCompatActivity) context).finish();
he use two different package names this package name in build.gradle as applicationId
com.universallauncher.universallauncher
this package name use in all java code
com.android.launcher3
so maybe you need to do like this
final Intent flick = new Intent("com.universallauncher.universallauncher/com.android.launcher3.FLICK_ICON_PACK_APPLIER");
//before com.android.launcher3
flick.setPackage("com.universallauncher.universallauncher/com.android.launcher3");
flick.putExtra("com.universallauncher.universallauncher/com.android.launcher3.extra.ICON_THEME_PACKAGE", context.getPackageName());
flick.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(flick);
((AppCompatActivity) context).finish();
maybe i'm wrong but try it
What I've do:
Class ApplyIconPack.java
public class ApplyIconPack extends BroadcastReceiver{
public static final String ICON_PACK_APPLIER_ACTION = "com.android.launcher3.FLICK_ICON_PACK_APPLIER";
public ApplyIconPack(){
}
@Override
public void onReceive(Context context, Intent intent) {
Log.i("ApplyIconPack", "new Intent Received ");
//Apply icon pack method here
}
}
Then in onCreate()
ApplyIconPack receiver = new ApplyIconPack();
IntentFilter intentFilter = new IntentFilter(ApplyIconPack.ICON_PACK_APPLIER_ACTION);
registerReceiver(receiver, intentFilter);
in Manifest.xml
<receiver android:name=".util.ApplyIconPack">
<intent-filter>
<action android:name="com.android.launcher3.FLICK_ICON_PACK_APPLIER" />
</intent-filter>
</receiver>
Package name: com.android.launcher3 App id: com.universallauncher.universallauncher
This one should works CandyBar.apk
No, it always tell me to install Flick Launcher...
this code open the FlickLauncher Choose Icon
val flick = Intent()
flick.`package` = "com.universallauncher.universallauncher"
flick.putExtra("com.universallauncher.universallauncher/com.teslacoilsw.launcher.APPLY_ICON_THEME",packageName)
flick.flags = Intent.FLAG_ACTIVITY_NEW_TASK
startActivity(flick)
but after i click on the Choose icon Flick Launcher close
So my code in onCreate()
is
if(getIntent()!=null && getIntent().getAction()!=null && getIntent().getAction().equals("com.android.launcher3.FLICK_ICON_PACK_APPLIER")){
String iconPackPackage = getIntent().getStringExtra("icon_pack_package");
if(iconPackPackage!=null && !iconPackPackage.isEmpty()) {
//update icon
}
}
other things to do?
You should do:
final Intent flick = new Intent("com.universallauncher.universallauncher/com.android.launcher3.FLICK_ICON_PACK_APPLIER");
flick.setPackage("com.universallauncher.universallauncher/com.android.launcher3");
flick.putExtra("com.universallauncher.universallauncher/com.android.launcher3.FLICK_ICON_PACK_APPLIER", context.getPackageName());
//or this flick.putExtra("icon_pack_package", context.getPackageName());
flick.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(flick);
((AppCompatActivity) context).finish();
That's not working, the log:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.universallauncher.universallauncher/com.android.launcher3.FLICK_ICON_PACK_APPLIER flg=0x10000000 pkg=com.universallauncher.universallauncher/com.android.launcher3 (has extras) }
Anyway my launcher/dafault activity is com.universallauncher.universallauncher.Launcher if you call this with string extra "icon_pack_package" to identify icon pack string and with this action: "com.universallauncher.universallauncher.FLICK_ICON_PACK_APPLIER", and send me apk
add this to fix, but YOU CANNO'T TEST because you don't have new update, so pass me apk with this
//Todo: fix direct apply for flick launcher
try {
final Intent flick = context.getPackageManager().getLaunchIntentForPackage(
"com.universallauncher.universallauncher");
final Intent flickAction = new Intent("com.universallauncher.universallauncher.FLICK_ICON_PACK_APPLIER");
flickAction.putExtra("com.universallauncher.universallauncher.ICON_THEME_PACKAGE", context.getPackageName());
flick.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.sendBroadcast(flickAction);
context.startActivity(flick);
((AppCompatActivity) context).finish();
} catch (ActivityNotFoundException | NullPointerException e) {
openGooglePlay(context, launcherPackage, launcherName);
}
break;
Fixed!
I am trying to get this same problem figure out do you have a true fix for this i read this thread 5 times and nothing in it is letting me apple my icon pack to flick launcher
I'm the creator of CandyBar dashboard for icon pack. It will be very helpful if user able to apply icon pack directly from the dashboard without opening Flick Launcher settings.
Something like Aviate launcher has (Scroll to bottom)
Or like Nova launcher has
Which will open a dialog ask if user want to apply the icon pack or directly apply the icon pack.