Example usage for android.content Intent Intent

List of usage examples for android.content Intent Intent

Introduction

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

Prototype

protected Intent(Parcel in) 

Source Link

Usage

From source file:Main.java

public static void reboot(Context context) {

    Intent intent = new Intent(Intent.ACTION_REBOOT);
    intent.putExtra("nowait", 1);
    intent.putExtra("interval", 1);
    intent.putExtra("window", 0);
    context.sendBroadcast(intent);/*from  w w w  . j  ava 2 s.com*/

}

From source file:Main.java

public static void showGpsOptions(Context context) {
    context.startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS));
}

From source file:Main.java

public static Intent getHomeIntent() {
    final Intent intent = new Intent("com.announcify");
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    return intent;
}

From source file:Main.java

public static void applyPermission(Context context) {
    Intent intent = new Intent("com.meizu.safe.security.SHOW_APPSEC");
    intent.setClassName("com.meizu.safe", "com.meizu.safe.security.AppSecActivity");
    intent.putExtra("packageName", context.getPackageName());
    context.startActivity(intent);/* ww w .java 2s.co m*/
}

From source file:Main.java

public static void openNetworkSetting(Context context) {
    context.startActivity(new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS));
}

From source file:Main.java

public static Intent getUninstallAppIntent(String packageName) {
    Intent intent = new Intent(Intent.ACTION_DELETE);
    intent.setData(Uri.parse("package:" + packageName));
    return intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}

From source file:Main.java

public static void closeNaviVoice_amap(Context context) {
    Intent mIntent = new Intent("com.autonavi.minimap");
    mIntent.putExtra("NAVI", "CLOSE_VOICE");
    context.sendBroadcast(mIntent);/*from w w w  .j  av  a  2s.c  om*/

}

From source file:Main.java

public static void addHome(Context context) {
    Intent homeIntent = new Intent("android.intent.action.MAIN");
    homeIntent.addCategory("android.intent.category.HOME");
    homeIntent.addCategory("android.intent.category.DEFAULT");
    Intent chooserIntent = new Intent(Intent.ACTION_CHOOSER);
    chooserIntent.putExtra(Intent.EXTRA_INTENT, homeIntent);
    context.startActivity(chooserIntent);

}

From source file:Main.java

public static void applyPermission(Context context) {
    Intent intent = new Intent("com.meizu.safe.security.SHOW_APPSEC");
    intent.setClassName("com.meizu.safe", "com.meizu.safe.security.AppSecActivity");
    intent.putExtra("packageName", context.getPackageName());
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);//from  w  w  w  . j a  va2 s .  co m
}

From source file:Main.java

public static void setAppState(int i, Context context) {
    Intent stateUpdate = new Intent("com.quicinc.Trepn.UpdateAppState");
    stateUpdate.putExtra("com.quicinc.Trepn.UpdateAppState.Value", i);
    context.sendBroadcast(stateUpdate);/*from   www  .  j ava  2 s .c om*/
}