-2

I am new in Android and have very small issue, i want to know what code i need to use to get image.

like if we use this to get text :

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

So what we use to get Image ?

CODE:

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();
Sun
  • 6,768
  • 25
  • 76
  • 131

2 Answers2

0

ImageView.getDrawable() will return the Drawable set in an ImageView

biddulph.r
  • 5,226
  • 3
  • 32
  • 47
0

if you've used setImageDrawable() to set image to the ImageView then you can use imgv.getDrawable() method to get the image.

d3m0li5h3r
  • 1,957
  • 17
  • 33