zoukankan      html  css  js  c++  java
  • 带有返回值的intent

    1.启动activity 

      

    Intent intent = new Intent(MainActivity.this,Other.class);
    intent.putExtra("message", a+" + "+b+" = ");
    startActivityForResult(intent, 1000);

    2.重写onActivityResult 比较请求码和返回码

     if(requestCode==1000 && resultCode==1001){}

    3.返回结果

    Intent intent = new Intent();
    intent.putExtra("result", value);
    setResult(1001, intent);
    finish();

      

  • 相关阅读:
    bzoj1221
    hdu3377
    bzoj3930
    bzoj3976
    bzoj4237
    fzu1977
    hdu1693
    ural1519
    bzoj1264
    回答自己的提问
  • 原文地址:https://www.cnblogs.com/lihaolihao/p/3544120.html
Copyright © 2011-2022 走看看