我正在实现一个应用程序,我试图用毕加索加载照片,但我没有得到任何结果。我该如何解决呢?以下是我所做的:
public class FullScreenPhoto extends AppCompatActivity {
ActivityFullScreenPhotoBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding=ActivityFullScreenPhotoBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
//Retrieving image path
Intent intent = getIntent();
String path =intent.getStringExtra("image_path");
//value of path=/storage/emulated/0/Android/data/com.ticanalyse.mheath.bf/files/Pictures/AH144644_7972289747179568715.jpg
if (Objects.equals(path, "no_image")) {
binding.imageContainer.setVisibility(View.GONE);
binding.textView.setVisibility(View.VISIBLE);
}else{
Log.d("path",path);
binding.imageContainer.setVisibility(View.VISIBLE);
Picasso.get()
.load(path)
.into(binding.imageContainer);
}
}
}
1条答案
按热度按时间ldioqlga1#
我不确定picasso是否显示来自filePath的图像,但是glide可以做到。
与听众一起使用滑音,你一定能达到形象