Package com. guo;
Import java. io. File;
Import android. app. Activity;
Import android. graphics. Bitmap;
Import android. graphics. BitmapFactory;
Import android. OS. Bundle;
Import android. view. View;
Import android. view. View. OnClickListener;
Import android. widget. ImageView;
Public class MainAct extends Activity {
/** Called when the activity is first created .*/
Private ImageView img;
// SD image path
Private String filepath = "/sdcard/hot.png ";
@ Override
Public void onCreate (Bundle savedInstanceState ){
Super. onCreate (savedInstanceState );
SetContentView (R. layout. main );
Img = (ImageView) findViewById (R. id. img );
File file = new File (filepath );
If (file. exists ()){
Bitmap bm = BitmapFactory. decodeFile (filepath );
// Display the image to ImageView
Img. setImageBitmap (bm );
}
}
}
Package com. guo;
Import java. io. File;
Import android. app. Activity;
Import android. graphics. Bitmap;
Import android. graphics. BitmapFactory;
Import android. OS. Bundle;
Import android. view. View;
Import android. view. View. OnClickListener;
Import android. widget. ImageView;
Public class MainAct extends Activity {
/** Called when the activity is first created .*/
Private ImageView img;
// SD image path
Private String filepath = "/sdcard/hot.png ";
@ Override
Public void onCreate (Bundle savedInstanceState ){
Super. onCreate (savedInstanceState );
SetContentView (R. layout. main );
Img = (ImageView) findViewById (R. id. img );
File file = new File (filepath );
If (file. exists ()){
Bitmap bm = BitmapFactory. decodeFile (filepath );
// Display the image to ImageView
Img. setImageBitmap (bm );
}
}
}