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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:05:38+00:00 2026-06-02T03:05:38+00:00

In the following code, after pagination data is stored into database but when I

  • 0

In the following code, after pagination data is stored into database but when I fetch new data from database then custom list is not showing any data, but if I go to next tab and come back it start showing data (note: new data from database successfully fetched only custom list is not generated ), is there any thing that I am missing?

Below is code snippet

 private void getFeedsData() {
        // TODO Auto-generated method stub

        VictoriesDBAdapter mFeedsDBAdapter = new VictoriesDBAdapter(this,
                Constants.strFeedsTableName);

        try {
            // //////getting all Feeds Data from API into response
            mAppStatus = AppStatus.getInstance(this);
            List<NameValuePair> params = new ArrayList<NameValuePair>(2);
            params.add(new BasicNameValuePair(Constants.AUTH_KEY, mAppStatus
                    .getSharedStringValue(Constants.AUTH_KEY)));
            String pageNumber = new Integer(iPageNo).toString();
            params.add(new BasicNameValuePair("PAGE_NO", pageNumber));
            String strJsonReponse = RestClient.getInstance(this).doApiCall(
                    Constants.strFeedsTab, "GET", params);
            Log.i("Feeds Data Response...######",
                    String.valueOf(strJsonReponse));

            // Fetching web service Response
            // String strJsonReponse =
            // "[{\"title\":\"Invitation through Email\",\"user\":{\"email\":\"as@as.com\"},\"created_at\":\"2012-04-09T05:53:31Z\",\"id\":43},{\"title\":\"Sample Victory\",\"user\":{\"email\":\"mahesh@yopmail.com\"},\"created_at\":\"2012-04-10T15:56:32Z\",\"id\":49}]";
            // Log.i("JSON RESONSE.....####", strJsonReponse);
            if (isNewFlag == true)
                mFeedsDBAdapter.deleteAll();
            if (strJsonReponse.equals("[]")) {
                bIsLastPage = true;
                Log.i("emtryyyyyyyyyy", "NULL");
                generateCustomList();
            } else {

                ParseResult parser = new ParseResult();
                ArrayList<VictoriesDataModel> victoriesArray = parser
                        .parseVictoriesData(strJsonReponse, isPostedByFlag);
                dbFunctions.storeFeedsDataInDB(victoriesArray);


            }
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }


private void generateCustomList() {
        // TODO Auto-generated method stub
        VictoriesDBAdapter mFeedsDBAdapter = new VictoriesDBAdapter(
                FeedsActivity.this, Constants.strFeedsTableName);
    //  VictoriesDataModel mVictoriesDataModel = new VictoriesDataModel();
        ArrayList<VictoriesDataModel> victoriesData = mFeedsDBAdapter
                .getVictoriesList(0, FeedsActivity.this);
        listCustomListViewId.setAdapter(new FeedsListAdapter(
                FeedsActivity.this, victoriesData)); // display data into custom
                                                        // list
         listCustomListViewId.setOnScrollListener(new OnScrollListener() {

         @Override
         public void onScrollStateChanged(AbsListView view, int scrollState) {
         // TODO Auto-generated method stub

         }

         @Override
         public void onScroll(AbsListView view, int firstVisibleItem,
         int visibleItemCount, int totalItemCount) {
         // TODO Auto-generated method stub
         int lastInScreen = firstVisibleItem + visibleItemCount;
         // is the bottom item visible & not loading more already ? Load
         // more !
         Log.i("Endless List", "########firstVisibleItem"
         + firstVisibleItem);
         Log.i("Endless List", "########visibleItemCount"
         + visibleItemCount);
         Log.i("Endless List", "########last in screen" + lastInScreen);
         Log.i("Endless List", "########total Item" + totalItemCount);
         if ((totalItemCount != 0) && (lastInScreen == totalItemCount)
         && !(loadingMore)) {
         Log.i("Endless List", "########getting 10 more List items");

         if (!bIsLastPage) {
         // FeedsActivity.this.showDialog(0);
         iPageNo++;
         Log.i("Page No.....", String.valueOf(iPageNo));
         loadingMore = true;
         isNewFlag = false;
         getFeedsData();
         Log.i("control......", "At POssssssss");
         loadingMore = false;

         }
         }

         }
         });
    }
  • 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-02T03:05:39+00:00Added an answer on June 2, 2026 at 3:05 am

    call this method after the list adapter’s data changes:

    mFeedsDBAdapter.notifyDataSetChanged() ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: // After 8 seconds change the slide... var timeout
I have the following code where after a bool is true I want to
I have used the following code to display the previous and after years of
After getting the objectEnumerator in the following code, the set1 retain count goes to
I have the following code to display the paragraph of a post, after the
I've in the following code the progressbar working on the first page load. after
I use following code: Create a retry policy, when error, retry after 1 second,
I am getting Incorrect syntax near the keyword 'select' after executing the following code.
Similar to this question , after running the following code the browser dialog does
I have in my Form constructor, after the InitializeComponent the following code: using (WebClient

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.