私はMy Firstを開発するためのヘルプが必要です。 GoogleのAPIであるImageViewにURLの助けを借りてイメージを設定したいと考えています。私はデータがGoogleのAPIから来ているリストビューを持っています。 リストビューでは、picasso android libruaryの助けを借りてイメージを実装しています。ユーザーがlistViewから各リスト項目をクリックすると、フラグメントを使用しています。 listItemのCLickで、私はリストItemのデータを表示する必要があるフラグメントを開きます。画像は私がソースコードの下に使用しています詳細を表示したいDetailFragmentでタイプ文字列画像URLはimageviewに設定されていますAndroid
のである、ListViewコントロールのために、私はユーザ定義リストを使用しています
。この場所
foodresImage.setImageResource(b.getInt("ItemImage"));
上
@Override
public void findViewById() {
foodtitle=(TextView)mView.findViewById(R.id.detail_foodtext);
foodsubtitle=(TextView)mView.findViewById(R.id.detail_foodsubtext);
foodresImage=(ImageView)mView.findViewById(R.id.detail_image_left);
foodaddress=(TextView) mView.findViewById(R.id.detail_foodaddress);
Bundle b=getArguments();
b.getString("ItemName");
b.getString("ItemSubItem");
b.getInt("ItemImage");
b.getString("ItemAddress");
foodtitle.setText(b.getString("ItemName"));
foodsubtitle.setText(b.getString("ItemSubItem"));
foodresImage.setImageResource(b.getInt("ItemImage"));
foodaddress.setText(b.getString("ItemAddress"));
}
私は詳しく断片中の1つのImageViewのある私のイメージをしたいです。
URLで画像を読み込みたい場合は、PicassoまたはGlideを試してみましょう – anhtuannd