zoukankan      html  css  js  c++  java
  • onActivityResult 通过case对不同情况进行处理

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
    switch (resultCode) {
    case 10:
    Toast.makeText(getActivity(),"haha",Toast.LENGTH_SHORT);
    Bundle a = data.getExtras();
    String url = a.getString("picture");
    String alterusername = a.getString("username");
    Bitmap bm = BitmapFactory.decodeFile(url);
    avatarImg.setImageBitmap(bm);
    UserNameTextView.setText(alterusername);
    break;
    case 1:
    Bundle b = data.getExtras();
    String index = b.getString("servicepointname");
    UserFuWuTextView.setText(index);//设置服务范围的显示TextView
    break;
    case 20:
    Bundle c = data.getExtras();
    String username = c.getString("UserName");
    String userphone = c.getString("UserPhone");
    UserPhoneTextView.setText(userphone);
    UserNameTextView.setText(username);
    break;
    }

    super.onActivityResult(requestCode, resultCode, data);
    }
  • 相关阅读:
    zip
    sublime 3 注册码
    css3 文本控制自动换行
    ST3 package control
    cf1139D-Steps to One
    2019-2020 ACM-ICPC, Asia Xuzhou Regional Contest
    2018-2019 ACM-ICPC, Asia Jiaozuo Regional Contest
    Tree
    B
    多源对多源最短路
  • 原文地址:https://www.cnblogs.com/to-creat/p/5210900.html
Copyright © 2011-2022 走看看