Example usage for android.content Intent putExtra

List of usage examples for android.content Intent putExtra

Introduction

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

Prototype

@Deprecated
@UnsupportedAppUsage
public @NonNull Intent putExtra(String name, IBinder value) 

Source Link

Document

Add extended data to the intent.

Usage

From source file:Main.java

public static Intent getSMSIntent(String body) {
    Intent it = new Intent(Intent.ACTION_VIEW);
    it.putExtra("sms_body", body);
    it.setType("vnd.android-dir/mms-sms");
    return it;//  ww  w .  j  av  a  2  s  .co  m
}

From source file:Main.java

public static void storeCtsTestResult(Activity activity, float reportedFOV, float measuredFOV) {
    Intent it = new Intent();
    it.putExtra(REPORTED_FOV_EXTRA, reportedFOV);
    it.putExtra(MEASURED_FOV_EXTRA, measuredFOV);
    activity.setResult(Activity.RESULT_OK, it);
}

From source file:Main.java

public static void sendMessageText(Activity activity, String text) {
    Intent it = new Intent(Intent.ACTION_VIEW);
    it.putExtra("sms_body", text);
    it.setType("vnd.android-dir/mms-sms");
    activity.startActivity(it);/*from  w  ww  .j a v a 2  s . co m*/
}

From source file:Main.java

public static void finishActivityWithSetting(Activity paramActivity, String paramString1, String paramString2) {
    if (paramString1 != null) {
        Intent localIntent = new Intent();
        localIntent.putExtra("setting_raw", paramString1);
        localIntent.putExtra("setting_label", paramString2);
        paramActivity.setResult(-1, localIntent);
    }/*from  w  w w.j  a v a2s. co  m*/
    paramActivity.finish();
}

From source file:Main.java

public static void startActivityForSerializable(Activity context, Class<?> cls, Serializable data) {
    Intent intent = new Intent(context, cls);
    intent.putExtra("Serializable", data);
    context.startActivity(intent);/*  w w  w .j  a v a 2  s  . c om*/
}

From source file:Main.java

public static void startActivityForStringData(Activity activity, String name, Class<?> cls, String data) {
    Intent intent = new Intent(activity, cls);
    intent.putExtra(name, data);
    activity.startActivity(intent);/*from   w w  w  . j  a va 2s .c o m*/
}

From source file:Main.java

static public Intent broadcastLocationUpdate(Context context, Location location) {
    Intent intent = new Intent(POI_INTENTFILTER);
    intent.putExtra(EXTRA_LOCATION, location);
    return intent;
}

From source file:Main.java

public static void startActivityForData(Activity activity, Class<?> cls, String data) {
    Intent intent = new Intent(activity, cls);
    intent.putExtra("data", data);
    activity.startActivity(intent);//from w w  w.  j  a  v  a  2 s  .c  o m
}

From source file:Main.java

public static void searchWeb(Context context, String word) {
    Intent i = new Intent(Intent.ACTION_WEB_SEARCH);
    i.putExtra(SearchManager.QUERY, word);
    context.startActivity(i);//w  w  w.  ja  v a 2  s .co m
}

From source file:Main.java

public static void sendBroadcase(String name, Context activity, String content) {
    Intent intent = new Intent(name);
    intent.putExtra("content", content);
    LocalBroadcastManager.getInstance(activity).sendBroadcast(intent);
}