Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.app.Application;

import android.content.Intent;

import android.content.pm.ResolveInfo;

public class Main {
    public static String getHomeLauncherName(Application application) {
        final Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.addCategory(Intent.CATEGORY_HOME);
        final ResolveInfo res = application.getPackageManager().resolveActivity(intent, 0);
        if (res.activityInfo == null) {
            return "";
        }
        return res.activityInfo.loadLabel(application.getPackageManager()).toString();
    }
}