在其中加载图像的类:我从本地服务器的url中获取图像是“ http://localhost/student/api/Images/mazhar.jpg”,但是图像未显示url也是正确的,而且url在变量“ Userpic”中,但其未显示图像图片视图不知道为什么?
String Username, Userpic, Useremail, Usermobilenum;
URL PIC;
ImageView UserProfile_iv;
TextView UsernameTV, UseremailTV, UsercellnumberTV;
public Rider() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_rider, container, false);
UserProfile_iv = view.findViewById(R.id.userimage);
UsernameTV = view.findViewById(R.id.username_tv);
UseremailTV = view.findViewById(R.id.email_tv);
UsercellnumberTV = view.findViewById(R.id.usermobile_tv);
Bundle bundle = getArguments();
if (bundle != null)
{
Username = bundle.getString("USERNAME");
Userpic = bundle.getString("USERIMAGE");
Useremail = bundle.getString("USEREMAIL");
Usermobilenum = bundle.getString("USERPHONE");
if(Utility.isNetworkAvailable(getContext()))
{Picasso.with(getContext()).load(Userpic).into(UserProfile_iv);}
UsernameTV.setText(Username);
UseremailTV.setText(Useremail);
UsercellnumberTV.setText(Usermobilenum);
}