當前位置: 首頁>>代碼示例>>Java>>正文


Java Intent.putExtras方法代碼示例

本文整理匯總了Java中android.content.Intent.putExtras方法的典型用法代碼示例。如果您正苦於以下問題:Java Intent.putExtras方法的具體用法?Java Intent.putExtras怎麽用?Java Intent.putExtras使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.content.Intent的用法示例。


在下文中一共展示了Intent.putExtras方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: a

import android.content.Intent; //導入方法依賴的package包/類
public static boolean a(Context context, a aVar) {
    if (context == null || aVar == null) {
        com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.MMessage", "send fail, invalid argument");
        return false;
    } else if (e.j(aVar.p)) {
        com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.MMessage", "send fail, action is null");
        return false;
    } else {
        String str = null;
        if (!e.j(aVar.o)) {
            str = aVar.o + ".permission.MM_MESSAGE";
        }
        Intent intent = new Intent(aVar.p);
        if (aVar.n != null) {
            intent.putExtras(aVar.n);
        }
        String packageName = context.getPackageName();
        intent.putExtra(ConstantsAPI.SDK_VERSION, 570490883);
        intent.putExtra(ConstantsAPI.APP_PACKAGE, packageName);
        intent.putExtra(ConstantsAPI.CONTENT, aVar.m);
        intent.putExtra(ConstantsAPI.CHECK_SUM, b.a(aVar.m, 570490883, packageName));
        context.sendBroadcast(intent, str);
        com.tencent.mm.sdk.b.a.d("MicroMsg.SDK.MMessage", "send mm message, intent=" + intent
                + ", perm=" + str);
        return true;
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:28,代碼來源:a.java

示例2: onCreate

import android.content.Intent; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    if (intent == null) {
        finish();
    }
    if (intent.getAction() == null || !intent.getAction().startsWith("com.tmessages.openchat")) {
        finish();
        return;
    }
    Intent intent2 = new Intent(this, LaunchActivity.class);
    intent2.setAction(intent.getAction());
    intent2.putExtras(intent);
    startActivity(intent2);
    finish();
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:18,代碼來源:OpenChatReceiver.java

示例3: onClick

import android.content.Intent; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
	switch(v.getId()){
	case R.id.email:
		Intent intentText = new Intent(this, EditTextAty.class);
		Bundle bundle = new Bundle();
		bundle.putString(EditTextAty.BAR_TITLE, "找回密碼"); // EditAty的標題.
		bundle.putString(EditTextAty.INFO, ""); // EditTextAty中的tvInfo要顯示的綁定信息。
		bundle.putBoolean(EditTextAty.INFO_READONLY, false); // tvInfo是否隻讀.
		bundle.putString(EditTextAty.REGEX, RegexUtils.regexEmail); // 驗證合法的正則表達式,不需要則為空。
		bundle.putString(EditTextAty.ERROR_MSG, "郵箱格式不正確"); // 驗證錯誤時要顯示的文字.
		bundle.putString(EditTextAty.TIP, "請輸入郵箱地址"); // 輸入文本提示.
		bundle.putString(EditTextAty.OPERATE_TEXT, "確定"); // btnOperate顯示文本.
		bundle.putString(EditTextAty.OPERATE, EditTextAty.OPERATE_FIND_PWD_BY_EMAIL); // btnOperate執行什麽操作。
		bundle.putString(EditTextAty.OPERATE_ARGS, ""); // btnOperate具體操作參數。
		bundle.putSerializable(EditTextAty.OBJ, EmailNextActivity.class);
		intentText.putExtras(bundle);
		startActivity(intentText);
		break;
	}
}
 
開發者ID:SShineTeam,項目名稱:Huochexing12306,代碼行數:22,代碼來源:FindPwdActivity.java

示例4: onScanPress

import android.content.Intent; //導入方法依賴的package包/類
public void onScanPress(View v) {

        Intent scanIntent = new Intent(this, CardIOActivity.class);
        if (getIntent().hasExtra(CARD_IO)) {
            scanIntent.putExtras(getIntent().getBundleExtra(CARD_IO));
        } else {

            // customize these values to suit your needs.
            scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); // default: false
            scanIntent.putExtra(CardIOActivity.EXTRA_SCAN_EXPIRY, true); // default: false
            scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, true); // default: false
            scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, false); // default: false
            scanIntent.putExtra(CardIOActivity.EXTRA_USE_CARDIO_LOGO, true); // default: false
            scanIntent.putExtra(CardIOActivity.EXTRA_HIDE_CARDIO_LOGO, true); // default: false
            scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, true); // default: false
        }
        // MY_SCAN_REQUEST_CODE is arbitrary and is only used within this activity.
        startActivityForResult(scanIntent, CARDIO_REQUEST_ID);
    }
 
開發者ID:KingsMentor,項目名稱:Luhn,代碼行數:20,代碼來源:Luhn.java

示例5: doData

import android.content.Intent; //導入方法依賴的package包/類
private void doData(String content) {

        //有曆史數據
        if (historySearchData != null && historySearchData.size() > 0) {
            for (int i = 0; i < historySearchData.size(); i++) {
                if (content.equals(historySearchData.get(i))) {
                    //有重複的
                    position = i;
                }
            }

            if (position != -1) {
                historySearchData.remove(position);
                historySearchData.add(0, content);
            } else {
                historySearchData.add(0, content);
            }

        } else {
            //沒有曆史數據
            historySearchData.add(content);
        }

        mHistorySearchAdapter.notifyDataSetChanged();
        String histortStr = new Gson().toJson(historySearchData);
        PreferencesUtils.putString(SearchActivity.this, "histortStr", histortStr);

        Bundle bundle = new Bundle();
        bundle.putString("search", content);
        Intent intent = new Intent(SearchActivity.this, SearchResultActivity.class);
        intent.putExtras(bundle);
        startActivity(intent);     //跳轉到搜索結果界麵

    }
 
開發者ID:gaolhjy,項目名稱:cniao5,代碼行數:35,代碼來源:SearchActivity.java

示例6: push

import android.content.Intent; //導入方法依賴的package包/類
@JSMethod
    public void push(String path, String param) {
        if ("nativeA".equals(path)) {
            Context context = (Activity) mWXSDKInstance.getContext();
            Intent intent = new Intent();
            intent.setClass(context, NativeActivity.class);
            Bundle bundle = new Bundle();
//            bundle.putString("param", param);
            intent.putExtras(bundle);
            context.startActivity(intent);
        }
    }
 
開發者ID:weexext,項目名稱:ucar-weex-core,代碼行數:13,代碼來源:SchemaActivity.java

示例7: transferAge18

import android.content.Intent; //導入方法依賴的package包/類
@OnClick(R.id.main_18_share_icon)
public void transferAge18() {
    if (checkPerso()) {
        final Intent intent = new Intent(this, TransferLicenseActivity.class);
        Bundle b = new Bundle();
        b.putInt("age", 18);
        intent.putExtras(b);
        startActivity(intent);
    }
}
 
開發者ID:mDL-ILP,項目名稱:mDL-ILP,代碼行數:11,代碼來源:MainActivity.java

示例8: showActivityAnima

import android.content.Intent; //導入方法依賴的package包/類
public void showActivityAnima(Activity aty, Class clazz, int flags, Bundle bundle, int inAnima, int outAnima) {
    Intent i = new Intent(aty, clazz);
    i.putExtras(bundle);
    i.setFlags(flags);
    aty.startActivity(i);
    aty.overridePendingTransition(inAnima, outAnima);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:ActivityUtils.java

示例9: getCommentPendingIntent

import android.content.Intent; //導入方法依賴的package包/類
private PendingIntent getCommentPendingIntent(Bundle b) {
    // Intent to open Comments Activity
    TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
    stackBuilder.addParentStack(CommentsActivity.class);

    Intent commentsIntent = IntentUtils.getIntent(context, CommentsActivity.class);
    commentsIntent.putExtras(b);
    stackBuilder.addNextIntent(commentsIntent);

    // Set the pendingIntent on Notification.Builder
    //PendingIntent pendingIntent = PendingIntent.getActivity(context, id, commentsIntent, PendingIntent.FLAG_UPDATE_CURRENT);
    return stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
}
 
開發者ID:pedromassango,項目名稱:Programmers,代碼行數:14,代碼來源:CustomNotification.java

示例10: onPostItemClick

import android.content.Intent; //導入方法依賴的package包/類
@Override
public void onPostItemClick(int pos) {
    Bundle args = new Bundle();
    args.putInt(ARG_POST_ITEM_POS, pos);
    args.putString(ARG_POST_TYPE, "search");
    Intent intent = new Intent(this, PostDetailActivity.class);
    intent.putExtras(args);
    startActivity(intent);

}
 
開發者ID:fiepi,項目名稱:moebooru-android,代碼行數:11,代碼來源:PostSearchActivity.java

示例11: startActivity

import android.content.Intent; //導入方法依賴的package包/類
/**
 * [攜帶數據的頁麵跳轉]
 *
 * @param clz
 * @param bundle
 */
public void startActivity(Class<?> clz, Bundle bundle) {
    Intent intent = new Intent();
    intent.setClass(this, clz);
    if (bundle != null) {
        intent.putExtras(bundle);
    }
    startActivity(intent);
}
 
開發者ID:zhao-mingjian,項目名稱:qvod,代碼行數:15,代碼來源:BaseTitleActivity.java

示例12: onItemClick

import android.content.Intent; //導入方法依賴的package包/類
@Override
public void onItemClick(int position, View view) {
    Intent intent = new Intent(mContext, EditorActivity.class);
    TextView title = (TextView) view.findViewById(R.id.note_title);
    TextView content = (TextView) view.findViewById(R.id.note_content);
    Bundle bd = new Bundle();
    bd.putInt("class", 0x1);
    bd.putString("title", title.getText().toString());
    bd.putString("content", content.getText().toString());
    intent.putExtras(bd);
    startActivity(intent);
}
 
開發者ID:weimin96,項目名稱:shareNote,代碼行數:13,代碼來源:NoteActivity.java

示例13: getComponentIntent

import android.content.Intent; //導入方法依賴的package包/類
/**
 * 獲取其他應用組件的意圖
 *
 * @param packageName 包名
 * @param className   全類名
 * @param bundle      bundle
 * @return intent
 */
public static Intent getComponentIntent(String packageName, String className, Bundle bundle) {
    Intent intent = new Intent(Intent.ACTION_VIEW);
    if (bundle != null) intent.putExtras(bundle);
    ComponentName cn = new ComponentName(packageName, className);
    intent.setComponent(cn);
    return intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
 
開發者ID:angcyo,項目名稱:RLibrary,代碼行數:16,代碼來源:IntentUtils.java

示例14: showCourseDetail

import android.content.Intent; //導入方法依賴的package包/類
private void showCourseDetail(Bundle courseBundle){
    Intent i = new Intent(getActivity(),CourseDetailActivity.class);
    i.putExtras(courseBundle);
    startActivity(i);
}
 
開發者ID:Bruno125,項目名稱:Unofficial-Ups,代碼行數:6,代碼來源:CoursesFragment.java

示例15: sendGrantMessage

import android.content.Intent; //導入方法依賴的package包/類
private void sendGrantMessage() {
    Bundle args = new Bundle();
    args.putBoolean(Constants.GRANT, true);

    Intent intent = new Intent();
    intent.putExtras(args);
    intent.setAction(getPackageName());

    LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
    finish();
}
 
開發者ID:lolucosmin,項目名稱:PermissionsWrapper,代碼行數:12,代碼來源:RequestPermissionsActv.java


注:本文中的android.content.Intent.putExtras方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。