美文网首页iApp
iApp-v3 调用图库

iApp-v3 调用图库

作者: 明日未期 | 来源:发表于2019-10-11 12:58 被阅读0次

    新建uri.mjava文件,代码见Android代码URI转PATH,复制代码时把最外层删掉,即

    public class FileUriUtils{
    
    }
    
    //iyu
    javanew(intent,"android.content.Intent","String","android.intent.action.GET_CONTENT")
    java(setType,intent,"android.content.Intent.setType","String","image/*")
    java(null,activity,"android.app.Activity.startActivityForResult","android.content.Intent",intent,"int",2)
    

    //回调结果事件

    javags(resultCode,activity,"android.app.Activity","RESULT_OK")
    f(st_sC==2)
    {
      f(st_lC==resultCode)
      {
        java(uri,st_iT,"android.content.Intent.getData")
        call(path, "mjava", "uri.getByUri", activity, uri)
      }
    }
    

    摘自网络,稍作修改。

    相关文章

      网友评论

        本文标题:iApp-v3 调用图库

        本文链接:https://www.haomeiwen.com/subject/osutmctx.html