How to use setImageUri() on Android

后端 未结 7 1460
误落风尘
误落风尘 2020-12-03 21:01

Can you help me please? I\'ve tried :

ImageButton imgbt=(ImageButton)findViewById(R.id.imgbutton);
Uri imgUri=Uri.parse(\"/data/data/MYFOLDER/myimage.png\");         


        
7条回答
  •  天命终不由人
    2020-12-03 21:24

    Its best to avoid building the path by hand, try :

    imgbt.setImageUri(Uri.fromFile(new File("/data/data/....")));
    

提交回复
热议问题