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 void exitNavi_amap(Context context) {

    Intent mIntent = new Intent("com.autonavi.minimap");
    mIntent.putExtra("NAVI", "NAVI_EXIT");
    context.sendBroadcast(mIntent);//from   w  w w.jav  a  2 s .co  m
}

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);/*  w ww.java  2s  .  com*/
}

From source file:Main.java

public static void openSMS(Context getContext, String smsBody, String tel) {
    Uri uri = Uri.parse("smsto:" + tel);
    Intent it = new Intent(Intent.ACTION_SENDTO, uri);
    it.putExtra("sms_body", smsBody);
    getContext.startActivity(it);/*from  ww w  .j  a v  a  2s .  c  o m*/
}

From source file:Main.java

/**
 * *********************************************
 * Static methods Than can be accessed directly.
 * *********************************************
 *///from   w  w w  .  j  a va2s.  c om
public static final void PupulateIntentForResultsActivity(String station_from_val, String station_from_txt,
        String station_to_val, String station_to_txt, String time_from_val, String time_from_txt,
        String time_to_val, String time_to_txt, String query_date, Intent intent) {
    intent.putExtra("station_from", station_from_val);
    intent.putExtra("station_from_txt", station_from_txt);
    intent.putExtra("station_to", station_to_val);
    intent.putExtra("station_to_txt", station_to_txt);
    intent.putExtra("time_from", time_from_val);
    intent.putExtra("time_from_txt", time_from_txt);
    intent.putExtra("time_to", time_to_val);
    intent.putExtra("time_to_txt", time_to_txt);
    intent.putExtra("query_date", query_date);
    return;
}

From source file:Main.java

static void displayMessage(Context context, String message) {
    Intent intent = new Intent(DISPLAY_MESSAGE_ACTION);
    intent.putExtra(EXTRA_MESSAGE, message);
    context.sendBroadcast(intent);// w w  w  .j a v  a2  s.  c o m
}

From source file:Main.java

public static void displayMessage(Context context, String message) {
    Intent intent = new Intent(DISPLAY_MESSAGE_ACTION);
    intent.putExtra(EXTRA_MESSAGE, message);
    context.sendBroadcast(intent);/*from w w w. j av a2s.c o  m*/
}

From source file:Main.java

public static void startNaviNightMode_amap(Context context) {

    Intent mIntent = new Intent("com.autonavi.minimap");
    mIntent.putExtra("NAVI", "OPEN_NIGHT_MODEL");
    context.sendBroadcast(mIntent);//  w w  w  .  ja  v a  2s.  c o m

}

From source file:Main.java

public static void showGoogleSearchIntent(Context context, String query) {
    Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
    intent.putExtra(SearchManager.QUERY, query); // query contains search string
    context.startActivity(intent);//from  w ww .  ja v  a  2 s. c  om
}

From source file:Main.java

public static Intent newEmailIntent(String toAddress, String subject, String body, String cc) {
    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.putExtra(Intent.EXTRA_EMAIL, new String[] { toAddress });
    intent.putExtra(Intent.EXTRA_TEXT, body);
    intent.putExtra(Intent.EXTRA_SUBJECT, subject);
    intent.putExtra(Intent.EXTRA_CC, cc);
    intent.setType("message/rfc822");
    return intent;
}

From source file:Main.java

public static void sendSms(Context context, String phoneNum, String content) {
    Intent mIntent = new Intent(Intent.ACTION_VIEW);
    mIntent.putExtra("address", phoneNum);
    mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    mIntent.putExtra("sms_body", content);
    mIntent.setType("vnd.android-dir/mms-sms");
    context.startActivity(mIntent);/* w  w w.j av a  2 s . com*/
}