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 9127821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:22:23+00:00 2026-06-17T07:22:23+00:00

I am able to get the data from the sqlite database. However, when my

  • 0

I am able to get the data from the sqlite database. However, when my image url is null, it prevents my other things from getting displayed.

try{
                name.setText(nameString);
                school.setText(schoolString);
                psupervisor.setText(info.getPsupervisor());
                pdate.setText(info.getPdate());
                a.setChecked(Boolean.parseBoolean(info.getPtick1()));
                b.setChecked(Boolean.parseBoolean(info.getPtick2()));
                c.setChecked(Boolean.parseBoolean(info.getPtick3()));
                pcomment1.setText(info.getPcomment1());
                psignature1.setImageBitmap(resizeSignatureBitmap(info.getPsignature1()));
                pcomment2.setText(info.getPcomment2());
                psignature2.setImageBitmap(resizeSignatureBitmap(info.getPsignature2()));
                pdate2.setText(info.getPdate2());
                d.setChecked(Boolean.parseBoolean(info.getPtick4()));
                e.setChecked(Boolean.parseBoolean(info.getPtick5()));
                f.setChecked(Boolean.parseBoolean(info.getPtick6()));
                pcomment3.setText(info.getPcomment3());
                psignature3.setImageBitmap(resizeSignatureBitmap(info.getPsignature3()));
                pcomment4.setText(info.getPcomment4());
                psignature4.setImageBitmap(resizeSignatureBitmap(info.getPsignature4()));
                Log.d("PREPOST: ", log2);
                db.close();
            }
            catch(Exception ex){}

        }

For example if psignature2 is null, the items from pdate2 to pcomment4 would not get displayed. Didn’t crash due to the try-catch therefore I discovered the cause of error late

My method for adjustment of bitmap resolution:

public Bitmap resizeSignatureBitmap(String imagePath){

     BitmapFactory.Options options = new BitmapFactory.Options();
    InputStream is = null;
    try {
            is = new FileInputStream(imagePath);
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    BitmapFactory.decodeStream(is,null,options);
    try {
            is.close();
        } catch (IOException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
    try {
            is = new FileInputStream(imagePath);
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    // here w and h are the desired width and height
    options.inSampleSize = Math.max(options.outWidth/w, options.outHeight/h);
    // bitmap is the resized bitmap
    Bitmap bitmap = BitmapFactory.decodeStream(is,null,options);
    is=null;
     return bitmap;
 }

Therefore, can anyone suggest any methods that I can do so that even if there is a null image url, it would not prevent the display of other image? Thanks!

  • 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-17T07:22:24+00:00Added an answer on June 17, 2026 at 7:22 am

    In resizeSignatureBitmap you can apply a check at the end to check weather the bitmap to be returned is null or not. In case its null you can return some default bitmap.

    Or you can simply set images in separate try catch blocks.

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

Sidebar

Related Questions

I want to insert data from database to table. I am able to get
I am able to get the current page's url in jsf from back-end bean
I have a sqlite database. I am able to query it and get a
I am getting data from the other table using webservices.I am tracing each value
I am able to update sqlite database and retrieving the data through a thread
I am able to manually get the user's data, but not programatically. Using the
I am caching all data I'm getting in my App inside a SQLite DB...
In my iPhone App I want to retrieve image from (stored in ) sqlite
Hi I am developing an android in which I am loading data from database
I want to be able to get the next and previous row using SQLite.

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.