service在数据库中查找到了值 用Intent跳转到了一个activity中 我想把数据库查到的值 显示到activity中 可是用Intent传值 可是activity得到的是null啊,还报空指针异常 求高手帮解决!!!!小弟不胜感激
解决方案 »
- 安卓中TextView跑马灯效果怎么显示
- 通过new Intent(MediaStore.ACTION_IMAGE_CAPTURE)调用照相机照相时,按钮监听问题
- 能否在一个button上加几个textview?
- Android系统可以只用C语言开发么?
- 求助下-android开发:安装软件时才执行(或者说首次运行时才执行)的操作该写在哪呢?
- 如何顺利流畅运行Eclipse的Android开发呢?
- Android中什么sqlite保存的字符串末尾都要以\0结尾?
- 请问关于显示图片的适配问题
- 安装Genymotion时出错,求大神指导该怎么做
- 一个小问题搞晕了,求解啊
- android文件监控
- 1024*600 Android平板电脑模拟器
--------------------------------------------------------------
下一个activity
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.result); //获取到上一个页面传过来的Intent intent=this.getIntent(); //获取Intent中的Bundle数据 bl=intent.getExtras(); String sex=bl.getString("sex"); double height=bl.getDouble("height");
Bundle myBundelForName=new Bundle();
myBundelForName.putString("massage", "I am in");
mIntent.putExtras(myBundelForName);
//设置要跳转到的Activity
mIntent.setClass(MyNoticeActivity.this, Activity2.class);
//设置点击下拉状态栏列表里的这个通知时所要显示的Activity
mPendingIntent = PendingIntent.getActivity(MyNoticeActivity.this, 0, mIntent, 0);activity:String massage = this.getIntent().getString("massage");可是操作时候 总是报 String massage = this.getIntent().getString("massage");的空指针异常
Bundle bundle = new Bundle();bundle = intent.getExtras();
String massage = bundle.getString("massage");
改成 String massage = this.getIntent().getExtras().getString("massage");