android读取手机sd卡单个图片,绝对路径

package your.imagesdka;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Environment;
import android.widget.ImageView;

public class Image_sd_kaActivity extends Activity {
	private ImageView iv;
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		String path2 = "/sdcard/liu.jpg";
		iv = (ImageView) findViewById(R.id.iv);
//		String path = Environment.getExternalStorageDirectory() + "/";
		Bitmap bitmap = BitmapFactory.decodeFile(path2);
		iv.setImageBitmap(bitmap);
	}
}

 

你可能感兴趣的:(android读取手机sd卡单个图片,绝对路径)