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 chooseFileIntent(Activity activity) {
    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("image/*");
    activity.startActivityForResult(intent, FILE_PICK);
}

From source file:Main.java

public static void showInputMethodSettingsPage(Context context) {
    Intent intent = new Intent(Settings.ACTION_INPUT_METHOD_SETTINGS);
    context.startActivity(intent);/*from w w w. ja va2s.  c  o  m*/
}

From source file:Main.java

public static void uninstallApk(Context context, String packageName) {
    Intent intent = new Intent(Intent.ACTION_DELETE);
    Uri packageURI = Uri.parse("package:" + packageName);
    intent.setData(packageURI);//from  w w w .  ja  v a 2  s .co m
    context.startActivity(intent);
}

From source file:Main.java

public static void toSettingActivity(Context mContext) {
    Intent settingsIntent = new Intent(Settings.ACTION_SETTINGS);
    mContext.startActivity(settingsIntent);
}

From source file:Main.java

public static void searchContent(Context context, String content) {
    Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
    intent.putExtra(SearchManager.QUERY, content);
    context.startActivity(intent);//www  .j  av  a  2 s .c  o  m
}

From source file:Main.java

public static void locationMarket(Context context, String packangeName) {
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("market://details?id=" + packangeName));
    context.startActivity(intent);// ww  w  .  ja  v a2  s .c om
}

From source file:Main.java

public static void uninstallApp(Context context, String appPackageName) {
    Intent intent = new Intent(Intent.ACTION_DELETE);
    intent.setData(Uri.parse("package:" + appPackageName));
    context.startActivity(intent);//w w  w  .j  a va 2 s.  c  o  m
}

From source file:Main.java

public static void uninstallApk(Context context, String packageName) {
    Intent intent = new Intent(Intent.ACTION_DELETE);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    Uri packageURI = Uri.parse("package:" + packageName);
    intent.setData(packageURI);// w w  w.  j a  va  2  s  .  c o  m
    context.startActivity(intent);
}

From source file:Main.java

public static void openGooglePlayForApp(Context context, String namespace) {
    Intent inPlay = new Intent(Intent.ACTION_VIEW);
    inPlay.setData(Uri.parse("market://details?id=" + namespace));
    context.startActivity(inPlay);/*from  w  w  w .ja va  2 s .  co  m*/
}

From source file:Main.java

public static Intent getAndroidShareIntent(CharSequence chooseTitle, CharSequence subject,
        CharSequence content) {/*from  w  w  w .  j a  v a2  s .  c o  m*/
    Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
    shareIntent.setType("text/plain");
    shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
    shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, content);
    return Intent.createChooser(shareIntent, chooseTitle);
}