Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8714239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:32:57+00:00 2026-06-13T05:32:57+00:00

While I load an image from SD to imageview, the image is blur. To

  • 0

While I load an image from SD to imageview, the image is blur.

To improve image quality… any solution..?

Here is the code…

Bitmap image = null;
                try {
                    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 filePath = cursor.getString(columnIndex);
                    cursor.close();
                    File file = new File(filePath);
                    image = decodeFile(file);

                } catch (java.lang.OutOfMemoryError e) {
                    e.printStackTrace();
                    Toast.makeText(getApplicationContext(),
                            "Image size is too large !", Toast.LENGTH_SHORT)
                            .show();
                } catch (Exception e) {
                    e.printStackTrace();
                    Toast.makeText(getApplicationContext(),
                            "Try with different image !",
                            Toast.LENGTH_SHORT).show();
                }
                mainImage = (ImageView) findViewById(R.id.img_mainImg);
                mainImage.setImageBitmap(image);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:32:58+00:00Added an answer on June 13, 2026 at 5:32 am

    Image from data return low quality image. Try using a file path and get the image from file path.

    here i show to get last image path

    private String getLastImagePath() {
            final String[] imageColumns = { MediaStore.Images.Media._ID,
                    MediaStore.Images.Media.DATA };
            final String imageOrderBy = MediaStore.Images.Media._ID + " DESC";
            Cursor imageCursor = managedQuery(
                    MediaStore.Images.Media.EXTERNAL_CONTENT_URI, imageColumns,
                    null, null, imageOrderBy);
            if (imageCursor.moveToFirst()) {
                int id = imageCursor.getInt(imageCursor
                        .getColumnIndex(MediaStore.Images.Media._ID));
                String fullPath = imageCursor.getString(imageCursor
                        .getColumnIndex(MediaStore.Images.Media.DATA));
                return fullPath;
            } else {
                return "";
            }
        }
    

    So, Same way get full image path to convert bitmap and show it imageview.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Crontab always try to load mysql-python image from my home directory, while the library
How can I load an image from photo library and show it in imageView
I have activity that load's image from server into imageview. Image is displayed after
When you load a bitmap from the resources like so: iv.setImageResource(R.drawable.image); if the bitmap
When I load an image from the media gallery into a Bitmap, everything is
I want to load up a random image while a page it is loading
While trying to load a Bitmap onto a SWFLoader the Event.COMPLETE event is not
I have this code that pulls an image from an url and displays it
How do I save an image file from data manipulated using image.load()? This is
The following code downloads a image from Amazon S3 into the device, and then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.