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

  • SEARCH
  • Home
  • 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 9076575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:08:31+00:00 2026-06-16T19:08:31+00:00

In my scenario i am having 3 records in sqlite which were fetched from

  • 0

In my scenario i am having 3 records in sqlite which were fetched from websercive that contains id,name,description and image now i want to display the first record and second one after flipping the first record.and 3 one after second record flips..

What i have done so far is

  while (cursor.moveToNext())
    {

         String temp_bookid = cursor.getString(0);
         Log.i("temp_bookid",temp_bookid);
         String temp_desc=cursor.getString(1);
         byte[] temp_image1 = cursor.getBlob(2);
         byte[] temp_image2 = cursor.getBlob(3);
         String temp_id=cursor.getString(4);
         String temp_name = cursor.getString(5);
         String temp_bname=cursor.getString(6);
         mapId.add(temp_id);
         mapBname.add(temp_bname);
         mapBookId.add(temp_bookid);
         mapName.add(temp_name);
         mapDesc.add(temp_desc);
         map2.add(temp_image2);
         map1.add(temp_image1);
            Log.i("temp_id of the page in sqlite", temp_id);

            TextView txtDesc = (TextView) findViewById(R.id.tDescription);
            text = (TextView) findViewById(R.id.tTitle);
            text.setText(temp_name);

            txtDesc.setText(temp_desc);

            ImageView img = (ImageView)findViewById(R.id.smallImage);


            img.setImageBitmap(BitmapFactory.decodeByteArray(temp_image1, 0,temp_image1.length));
            txtName1 = (TextView) findViewById(R.id.tvName);
            txtName1.setText(temp_bname);

            break;
    }   

            mContext = this;
        vf = (ViewFlipper) this.findViewById(R.id.vfShow);
        vf.setOnTouchListener(new OnTouchListener() {
        @Override
            public boolean onTouch(final View view, final MotionEvent event) {
                detector.onTouchEvent(event);
                Log.i("ew","ae");

                return true;
            }
        });

I am able to display first record data when i set break; statement otherwise it is displaying last record data..How can proceed for this approach?

  • 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-16T19:08:33+00:00Added an answer on June 16, 2026 at 7:08 pm

    First fetch all the records and store in List<YourDataClass> myList object from onCreate method. As I have just giving you the examples

    Now after fetching the data and stored in your list object you need to implement flipper change event so when flipper was change get the current position and using this position get the data as object from your list object. As you move right/left it will giving you the current position and you just need to use this position to fetch the records from list object

    For example

    Your POJO class will store the data MyData.java

    public class MyData{
        public long id = -1;
        public String name = "";
        public String description = "";
        public String imagePath = ""; /// I don't know you want exactly, you need to implement image as per your requirement.
    }
    

    In your activity

    private List<MyData> myList = new ArrayList<MyData>();
    
    
    oncreate(){
    
    fetchData(); // you need to implement this in AsyncTask so UI was not block just implement AsyncTask and call this method in doInBackground().
    
    // after this you can implment View flipper and add view and set the data by fetch the list object using current view flipper position.
    
    }
    
    private void fetchData(){
    
        while (cursor.moveToNext()){
             MyData myData = new MyData();
             myData.id = cursor.getLong(0);
             myData.desc=cursor.getString(1);
             myData.name = cursor.getString(5);
             list.add(myData);
             myData = null;
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to find records that has the following scenario. ID | name
The scenario is that i have a bulky database of around 500,000 records having
I am having trouble in retrieving DISTINCT records. Scenario is as follow: Right now
Scenario Having already read a post on this on the same site, which didn't
I am having a scenario, in which i have multiple delegates attached to the
Scenario: I have an application (C#) that expects a SQL database and login, which
I don't understand svn merge. Here's the scenario: We have a branch that contains
I am having a scenario where I need to call a java method which
I'm having a scenario where I had to deploy multiple directories for different languages.
I'm having trouble with the following scenario: 2 Edit's Type something in Edit1 and

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.