传值方法一

Intent intent = new Intent();Bundle bundle = new Bundle(); //该类用作携带数据bundle.putString("name", "tom"); bundle.putString("ip","8.8.8.8");intent.putExtras(bundle); //为Intent追加额外的数据

传值方法二

Intent intent = new Intent();intent.putExtra("name", "tom"); intent.putExtra("money", 1098978009L);

获取值

Bundle bundle=getIntent().getExtras();String name=bundle.getString("name");



更多相关文章

  1. Android(安卓)JSON数据与实体类之间的相互转化-------GSON实现
  2. Android中启动外部程序
  3. android 使用SharedPreferences保存list数据
  4. Android(安卓)积累一些RxJava2.0有关的知识
  5. android中SharedPerferences保存数据
  6. 重学Android——View的事件分发
  7. android手记之----Activity
  8. 【Android】如何使默认图库中获得的图像旋转成正确的方向

随机推荐

  1. 整理的Android多种控件步骤
  2. Android 干货文章集锦
  3. Android通过SystemProperties获取build.p
  4. 最新版的Android4.4.2 SDK无法下载解决
  5. Android View的onTouchEvent和OnTouch区
  6. ActionBarImpl can only be used with a
  7. Android(安卓)RecyclerView滚动定位
  8. android 下载 并显示 progressDialog
  9. 【Android】 Android-wifi 直连 wifi dir
  10. Android内存泄漏检测-LeakCanary