本文整理汇总了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;
}
}
示例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();
}
示例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;
}
}
示例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);
}
示例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); //跳转到搜索结果界面
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例14: showCourseDetail
import android.content.Intent; //导入方法依赖的package包/类
private void showCourseDetail(Bundle courseBundle){
Intent i = new Intent(getActivity(),CourseDetailActivity.class);
i.putExtras(courseBundle);
startActivity(i);
}
示例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();
}