Cannot resolve method 'putExtra(android.os.Bundle)' Intent界面跳转传值
2016-04-29 11:57
691 查看
今天在做界面的跳转的时候 .putExtra(mBundle) 一直报错,提示错误是: Cannot resolve method 'putExtra(android.os.Bundle)' 这是跳转部分代码: switch (v.getId()){ case R.id.search_not_baidu: Bundle mBundle = new Bundle(); mBundle.putString("webUrl","http://www.baidu.com"); startActivity(new Intent(context, JumpWepPageActivity.class).putExtra(mBundle)); context.finish(); break; case R.id.search_not_360: context.finish(); break; } 按说不应该啊 我跳转一直这么写怎么会出错呢 一直没找到原因! 后来我从之前的逻辑差不多的一段跳转代码里 复制了过来, 覆盖掉这段代码然后就没事了 ! 郁闷…… 都一样啊 这是我从从之前的代码里找的逻辑差不多的代码:
hot_listview.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Bundle mBundle = new Bundle(); mBundle.putInt("Id",Integer.valueOf(specialInfoCommonAdapter.getItem(position).getId())); startActivity(new Intent(context, SpecialBrandDetailsActivity.class).putExtras(mBundle)); } }); 是不是一样的 跳转逻辑! 开始以为是不是包导错了 结果检查了发现 根本不是…… 希望有朋友遇到同样问题解决了的 可以和我说一下
相关文章推荐
- Android 使用Intent传递数据的实现思路与代码
- Android组件间通信--深入理解Intent与IntentFilter
- Android中Intent机制详解及示例总结(总结篇)
- 详解Activity之singletast启动模式及如何使用intent传值
- Intent传递对象之Serializable和Parcelable的区别
- Android中的Intent对象完全解析
- android教程之intent的action属性使用示例(intent发短信)
- 从源码剖析Android中的Intent组件
- Android编程开发之打开文件的Intent及使用方法
- Android中Intent习惯用法
- Android使用Intent启动其他非系统应用程序的方法
- Android Intent启动别的应用实现方法
- 详解Android中Intent的使用方法
- Android开发之利用Intent实现数据传递的方法
- Android编程使用Intent传递对象的方法分析
- Android中Intent传递对象的两种方法Serializable,Parcelable
- Android中的Intent Filter匹配规则简介
- 详解Android中Intent对象与Intent Filter过滤匹配过程
- 深入学习Android中的Intent
- Android学习之Intent中显示意图和隐式意图的用法实例分析