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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:58:47+00:00 2026-06-14T16:58:47+00:00

i connect my database to ListView like this: public void update_list(String NN) { c

  • 0

i connect my database to ListView like this:

public void update_list(String NN) {
       c = db.rawQuery(NN, null);
       startManagingCursor(c);
       String[] from = new String[]{"_id","Fname","Lname","Phone","Car","CarNum" };
       int[] to = new int[]{  R.id._id,R.id.Fname,R.id.Lname,R.id.Phone,R.id.Car,R.id.CarNum };
       SimpleCursorAdapter notes = new SimpleCursorAdapter (this, R.layout.my_list, c, from, to);
       setListAdapter(notes);
       setListAdapter(new SimpleCursorAdapter(this, R.layout.my_list, c, from,to) {

       @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View row = super.getView(position, convertView, parent);
        }
    });
    }

now i need to connect ImageView to picture

i have field PicNum that hold link to picture

i know to load picture to ImageView like this:

 MyPic = (ImageView) findViewById(R.id.MyPic);
        try
        {
        File imgFile = new File("/sdcard/MyPic/Unzip/" +MyParam.zPicNum+ ".jpeg");
        if(imgFile.exists()){
            Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
             MyPic.setImageBitmap(myBitmap);
            }
        else
        {
             MyPic.setImageBitmap(null);
        }
      }
      catch (Exception e) {
           MyPic.setImageBitmap(null);
    } 

how to combine this ImageView to my ListView ?

  • 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-14T16:58:48+00:00Added an answer on June 14, 2026 at 4:58 pm

    Try this to insert image to your list view:

    MySimpleAdapter notes;
    
        public class MySimpleAdapter extends SimpleCursorAdapter{
    
                public MySimpleAdapter(Context context, int layout, Cursor c, String[] from, int[] to) {
                    super(context, layout, c, from, to);
                }
    
                @Override
                public void setViewImage(ImageView v, String zPicNum) {
                    try{
                        String pathName = Environment.getExternalStorageDirectory().getPath() + "MyPic/Unzip/" +zPicNum+ ".jpeg";
                        File path = new File(pathName);
                        if(path.exists()){
                            BitmapFactory.Options options = new BitmapFactory.Options();
                            Bitmap bm = BitmapFactory.decodeFile(pathName, options);
                            v.setImageBitmap(bm);
                        }
                        else{
                            v.setImageResource(R.drawable.defaultpic);
                        }
                    }
                    catch (Exception e)
                    {
                       Toast.makeText(getActivity(), "error in finding images", Toast.LENGTH_LONG).show();
                    }
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In code igniter, you can connect database and make queries in controller like: $this->db->query(Your
i am new to web programming. i am trying to connect database using jsp
I need what are all the connection string wanted to connect database server (SQL
I connect a database on my server from the Android application and I want
<? // Connect database include(cat-config.php); // Get all records in all columns from table
i want to connect database to iphone sdk but it is taking the default
Is that possible to connect mysql database between servers. I mean, lets say i
i wrote program to connect oracle database 11g for my android application to store
I'm using LINQ to SQL to connect my database to my home page. I
I defined a role and grant it with only connect to database and execute

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.