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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:03:38+00:00 2026-06-16T17:03:38+00:00

I am caching all data I’m getting in my App inside a SQLite DB…

  • 0

I am caching all data I’m getting in my App inside a SQLite DB… Whenever the user doesn’t have internet connection the data is loaded with a SimpleCursorAdapter from the database.
The database also contains the URL of Images. The images are cached by the image loading framework I’m using (Universal-Image-Loader), so when I run the framework with the URL from the database it gets the cached image.
My question is how I can call this method inside my SimpleCursorAdapter?
Until now I have only been able to get all the texts from the database and attach them to TextViews…

Thanks for your help!

  • 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-16T17:03:41+00:00Added an answer on June 16, 2026 at 5:03 pm

    So I was finally able to get this done myself…

    I had to write a new method which extends CursorAdapter…

    There I had to assign all my Texts I got from my DB with the TextView. So I was also able to give my Image Loader the Link to the (cached) image to load…

    This is my code:

    private static final class MyCursorAdapter extends CursorAdapter {
    
        MyCursorAdapter(Context context, Cursor cursor, int flags) {
            super(context, cursor, flags);
    
            mInflater = LayoutInflater.from(context);
        }
    
        @Override
        public View newView(Context context, Cursor cursor, ViewGroup parent) {
            View v = mInflater.inflate(R.layout.row_twitter, parent, false);
            return v;
        }
    
        @Override
        public void bindView(View view, Context context, Cursor cursor) {
            TextView listtitle = (TextView) view.findViewById(R.id.listtitle);
            TextView listusername = (TextView) view.findViewById(R.id.listusername);
            TextView listdate = (TextView) view.findViewById(R.id.listdate);
    
            listtitle.setText(cursor.getString(cursor.getColumnIndex(DataDBAdapter.KEY_TWITTER_TWEET)));
            listusername.setText(cursor.getString(cursor.getColumnIndex(DataDBAdapter.KEY_TWITTER_USERNAME)));
            listdate.setText(cursor.getString(cursor.getColumnIndex(DataDBAdapter.KEY_TWITTER_DATE)));
    
            listtitle.setTextColor(Color.GRAY);
            listdate.setTextColor(Color.GRAY);
    
            ImageView iv = (ImageView) view.findViewById(R.id.image);
            imageLoader.displayImage(cursor.getString(cursor.getColumnIndex(DataDBAdapter.KEY_TWITTER_IMAGEURL)),
                    iv, options);
        }
    
        LayoutInflater mInflater;
    }
    

    And this actually works pretty well 🙂

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

Sidebar

Related Questions

In my root directory I have a htaccess file which is caching all sort
I'm working with caching and persistence for the first time. I have a user
We currently have an error catching script for all our PHP sites. This script
Greetings, I've been working on a C#.NET app that interacts with a data logger.
I have a few data values that I need to store on my rails
I'm currently working on a problem that basically involves processing all data in a
How can i disable http caching of all my http connections in my japplet?
well caching is a perfect way to speed up access to data which are
I am using the Asp.Net Caching mechanism for a highly frequent changing web app.
I'm building a product that involves a windows service caching data on the local

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.