-2

我是 Android 新手,问题很小,我想知道我需要使用什么代码来获取图像。

就像我们用它来获取文本一样:

name = txtname.getText().toString();

那么我们用什么来获取 Image 呢?

代码:

public static final String TAG_NAME = "name";
public static final String TAG_IMAGEURL = "imageurl"

String name, image ;

Intent in = getIntent();
String mname = in.getStringExtra(TAG_NAME);
String mimage = in.getStringExtra(TAG_IMAGEURL);

ImageLoader imageLoader = new ImageLoader(getApplicationContext());

final ImageView imgv = (ImageView) findViewById(R.id.image);
final TextView txtn = (TextView) findViewById(R.id.name);

txtn.setText(mname);
imageLoader.DisplayImage(mimage, imgv);

name = txttitle.getText().toString();
image = // here i want to know what i should need to use to get image 
         // like i am getting text using :::txttitle.getText().toString();
4

2 回答 2

0

如果您曾经setImageDrawable()将图像设置为 ImageView,那么您可以使用imgv.getDrawable()方法来获取图像。

于 2013-05-09T11:12:25.097 回答
0

ImageView.getDrawable()将返回Drawable集合ImageView

于 2013-05-09T11:10:46.847 回答