Example usage for android.content Intent setClassName

List of usage examples for android.content Intent setClassName

Introduction

In this page you can find the example usage for android.content Intent setClassName.

Prototype

public @NonNull Intent setClassName(@NonNull String packageName, @NonNull String className) 

Source Link

Document

Convenience for calling #setComponent with an explicit application package name and class name.

Usage

From source file:Main.java

public static Intent getBootSpeedActivityIntent() {
    Intent intent = new Intent();
    intent.setClassName("com.lenovo.safecenter", "com.lenovo.performancecenter.performance.BootSpeedActivity");
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    return intent;
}

From source file:Main.java

public static Intent getLeSafeMainActivityIntent() {
    Intent intent = new Intent();
    intent.setClassName("com.lenovo.safecenter", "com.lenovo.safecenter.MainTab.LeSafeMainActivity");
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    return intent;
}

From source file:Main.java

/** Google calendar intent variant 1 */
private static Intent constructGoogleCalendarIntentVariant1() {
    final Intent intent = new Intent();
    return intent.setClassName("com.android.calendar", "com.android.calendar.AgendaActivity");
}

From source file:Main.java

/**
 * Get the Engagement service intent to bind to.
 * @param context any application context.
 * @return an explicit intent that can used to bind to the service.
 *///from w ww.j  av a 2 s.c  o  m
public static Intent getServiceIntent(Context context) {
    /* Build the base intent */
    Intent intent = new Intent();
    intent.setClassName(context, SERVICE_CLASS);
    return intent;
}

From source file:Main.java

public static Intent getAddViewMonitorIntent() {
    Intent intent = new Intent();
    intent.setClassName("com.huawei.systemmanager",
            "com.huawei.systemmanager.addviewmonitor.AddViewMonitorActivity");
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    return intent;
}

From source file:Main.java

public static Intent getNotificationManageIntent() {
    Intent intent = new Intent();
    intent.setClassName("com.huawei.systemmanager",
            "com.huawei.notificationmanager.ui.NotificationManagmentActivity");
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    return intent;
}

From source file:Main.java

public static Intent getAppNotificationOpenManagerIntent() {
    Intent intent = new Intent();
    intent.setClassName("com.lenovo.systemuiplus",
            "com.lenovo.systemuiplus.notifymanager.AppNotificationOpenManager");
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    return intent;
}

From source file:Main.java

public static Intent getBootStartIntent() {
    Intent intent = new Intent();
    intent.setClassName("com.huawei.systemmanager",
            "com.huawei.systemmanager.optimize.bootstart.BootStartActivity");
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    return intent;
}

From source file:Main.java

public static Intent getAndroidAppNotificationOpenManager() {
    Intent intent = new Intent();
    intent.setClassName("com.android.systemui",
            "com.android.systemui.lenovo.settings.AppNotificationOpenManager");
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    return intent;
}

From source file:Main.java

public static void openGPS(Context context) {

    Intent GPSIntent = new Intent();

    GPSIntent.setClassName("com.android.settings", "com.android.settings.widget.SettingsAppWidgetProvider");

    GPSIntent.addCategory("android.intent.category.ALTERNATIVE");
    GPSIntent.setData(Uri.parse("custom:3"));

    try {//from  w w w  .j ava 2 s.  c om
        PendingIntent.getBroadcast(context, 0, GPSIntent, 0).send();
    } catch (PendingIntent.CanceledException e) {
        e.printStackTrace();
    }
}