2

I am trying to upgrade home app from .apk file stored in external sdcard. But, the bellow error appears infinity and then the device is re-booted itself.

09-25 11:58:44.040: I/ActivityManager(1313):   Force finishing activity ActivityRecord{4238d680 u0 com.jkpark.cluster/.MainActivity}
09-25 11:58:44.040: I/ActivityManager(1313): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.jkpark.cluster/.MainActivity} from pid 0

I guess the ActivityManager starts whatever home app when I call event to re-install my home app, but there isn't exist any home app else. So ActivityManager force starting and then calls starting home app again and again.

When I installed just another home app categoried "android.intent.category.HOME" and upgrade my home app, It works fine.

but, I want to upgrade without any other home app installed. So, anyone helps me please. Thank you.

JK Park
  • 107
  • 8
  • ___"I want to upgrade without any other home app installed."___ what do you mean **without** other home installed. do you want your home app to be the default home app for a rom. If yes then I guess this question will be more suitable for http://android.stackexchange.com/ – SMR Sep 23 '14 at 06:48

2 Answers2

1

I had a similar problem. During the launcher update process android OS has no home activity to run. This happens, because one thread is installing and one thread is trying to run the luncher and the same time. This problem is easy to solve by creating another Launcher, lets call it launcher switcher. This launcher has only one purpose - running your original louncher. Works like charm for me. This is a code for launcher switcher.

    private void runLauncher() {
    if(isMyLauncherDefault()) {
        unsetThisLauncherAsDefault();
    }

    final Handler handler = new Handler();
    handler.postDelayed(new Runnable() {
        @Override
        public void run() {
            Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(LAUNCHER_PACKAGE);
            startActivity(LaunchIntent);
        }
    }, TWO_SECONDS_IN_MILLISECONDS);
}

private boolean isMyLauncherDefault() {
    final IntentFilter filter = new IntentFilter(Intent.ACTION_MAIN);
    filter.addCategory(Intent.CATEGORY_HOME);

    List<IntentFilter> filters = new ArrayList<IntentFilter>();
    filters.add(filter);

    final String myPackageName = getPackageName();
    List<ComponentName> activities = new ArrayList<ComponentName>();
    PackageManager packageManager = (PackageManager) getPackageManager();

    packageManager.getPreferredActivities(filters, activities, LAUNCHER_SWITCHER_PACKAGE);

    if(activities.size() == NO_LAUNCHER)
        return true;

    for (ComponentName activity : activities) {
        if (myPackageName.equals(activity.getPackageName())) {
            return true;
        }
    }
    return false;
}

private void unsetThisLauncherAsDefault() {
    getPackageManager().clearPackagePreferredActivities(getPackageName());
}
jirkarrrr
  • 116
  • 1
  • 5
0

I think u just want to remove system homescreen app and only want ur app as a default launcher..

In that case u have to root your device to remove system app.. In android environment it is not possible to remove system apps without root access.

Aakash Gandhi
  • 253
  • 1
  • 3
  • 11