Intent获取数据和发送数据的办法:

//直接通过Intent发送
intent.putExtra("name","wytings");
//直接通过Intent接收
String mName= intent.getStringExtra("name"); //通过Bundle发送 Bundle bundle = new Bundle(); bundle.putString("NAME", "wytings"); intent.putExtras(bundle); //通过Bundle接收 Bundle bundle = intent.getExtras(); String mName= bundle.getString("NAME");

附:如果不知道intent里面有什么,建议用直接用Bundle获取全部内容,管他怎么发送的,拿过来再通过Bundle的方法进行处理~

相关文章:

  • 2021-08-30
  • 2021-11-11
  • 2021-09-21
  • 2022-02-05
  • 2022-12-23
  • 2021-05-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-07
  • 2021-04-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案