Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
selected image not showing in imageview
romasha ali
Jan 4 2018 6:18 AM
156
i set breakpoint but could not get the problem.. Could you please sort this out..I need to submit my project tonight..
MY COde:
Button buttonLoadImage = (Button) findViewById(R.id.button4);
buttonLoadImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v)
{
Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i, Selected_image);
}
});
}
protected void onActivityResult(int requestCode, int resultCode , Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == Selected_image && resultCode == RESULT_OK && null != data) {
Uri selectedImage = data.getData();
String[] filePathColumn = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(selectedImage,
filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();
ImageView imageView = (ImageView) findViewById(R.id.image_view);
imageView.setImageBitmap(BitmapFactory.decodeFile(picturePath));
}
}
Reply
Upload Source Code
Select only zip and rar file.
Post
Reset
Answers (
2
)
xamarin form cros platform
i cant add .db to xamarin.