Giter Club home page Giter Club logo

Comments (27)

michelelacorte avatar michelelacorte commented on August 16, 2024

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!

from flicklauncher.

danimahardhika avatar danimahardhika commented on August 16, 2024

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

from flicklauncher.

michelelacorte avatar michelelacorte commented on August 16, 2024

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)

from flicklauncher.

danimahardhika avatar danimahardhika commented on August 16, 2024

Check here. I only added 1 icon for Chrome.

from flicklauncher.

michelelacorte avatar michelelacorte commented on August 16, 2024

Candy app tell me Launcher is not installed (in installed section WTF?)...and open Google Play..

from flicklauncher.

danimahardhika avatar danimahardhika commented on August 16, 2024

I told you before, it doesn't works. You need to register the receiver inside flick launcher manifest.

from flicklauncher.

michelelacorte avatar michelelacorte commented on August 16, 2024

I've do that!..see screenshot

alt tag

alt tag

from flicklauncher.

danimahardhika avatar danimahardhika commented on August 16, 2024

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)

from flicklauncher.

michelelacorte avatar michelelacorte commented on August 16, 2024

Seems correct, but I don't understand wht it tell me "Flick Launcher is not installed" I've also tried with signed apk..

from flicklauncher.

michelelacorte avatar michelelacorte commented on August 16, 2024

So?? @danimahardhika

from flicklauncher.

danimahardhika avatar danimahardhika commented on August 16, 2024

Already follow your guide above, but not working.

  1. If the project you are using same with the one here, make sure to register the receiver in manifest. Because I don't see it here.
  2. Make sure to register the receiver inside activity too.

from flicklauncher.

michelelacorte avatar michelelacorte commented on August 16, 2024

Bro, you don't understand...Your apk doesn't work with my code (not updated in github, it's my private code!)

from flicklauncher.

danimahardhika avatar danimahardhika commented on August 16, 2024

I'm just following your guide. Nova launcher has similar code to apply icon pack and it works.

from flicklauncher.

danimahardhika avatar danimahardhika commented on August 16, 2024

What's the package name of flick launcher? Is it this one

com.universallauncher.universallauncher

from flicklauncher.

michelelacorte avatar michelelacorte commented on August 16, 2024

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!

from flicklauncher.

danimahardhika avatar danimahardhika commented on August 16, 2024

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();

from flicklauncher.

viztushar avatar viztushar commented on August 16, 2024

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

from flicklauncher.

michelelacorte avatar michelelacorte commented on August 16, 2024

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

from flicklauncher.

danimahardhika avatar danimahardhika commented on August 16, 2024

This one should works CandyBar.apk

from flicklauncher.

michelelacorte avatar michelelacorte commented on August 16, 2024

No, it always tell me to install Flick Launcher...

from flicklauncher.

viztushar avatar viztushar commented on August 16, 2024

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

screenshot_20170526-213141 1

from flicklauncher.

michelelacorte avatar michelelacorte commented on August 16, 2024

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();

from flicklauncher.

danimahardhika avatar danimahardhika commented on August 16, 2024

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) }

from flicklauncher.

michelelacorte avatar michelelacorte commented on August 16, 2024

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

from flicklauncher.

michelelacorte avatar michelelacorte commented on August 16, 2024

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;

from flicklauncher.

michelelacorte avatar michelelacorte commented on August 16, 2024

Fixed!

from flicklauncher.

Phonlab-Android avatar Phonlab-Android commented on August 16, 2024

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

from flicklauncher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.