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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:52:05+00:00 2026-06-10T19:52:05+00:00

Previously I had a do while loop that works really well now. This time

  • 0

Previously I had a “do while” loop that works really well now.
This time I can’t get my “while” only loop to work.

|-----|-------|------|------|
|._id.|..INFO.|.DONE.|.LAST.|
|..1..|...A...|...N..|......|
|..2..|...B...|...Y..|..L...|<--- cursor.moveToFirst();
|..3..|...C...|...Y..|......|
|..4..|...D...|...Y..|......|
|..5..|...E...|...N..|......|
|..6..|...F...|...N..|......|
|-----|-------|------|------|

My Code is:

cursor = db.rawQuery("SELECT * FROM " +TABLE_NAME+" WHERE "+LAST+" LIKE '%L%'", null);
cursor.moveToFirst();
if (!cursor.getString(cursor.getColumnIndex(_id)).equals(Long.toString(rowcount)))
{
  while(!cursor.isLast())
  {
    cursor.moveToNext();
    Toast.makeText(context, "your message", Toast.LENGTH_LONG).show();
  }
}

The loop is never entered into, I know this because my toast doesn’t pop up. I am just wondering why. I can do this another way, by using a “for” loop, but I am just wondering what I’ve done wrong with this while loop.

  • 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-10T19:52:05+00:00Added an answer on June 10, 2026 at 7:52 pm

    The query will only fetch the row which has the LAST value as ‘L’.
    The remaining rows will not be fetched. Hence the condition is not reached.

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

Sidebar

Related Questions

I previously had a post on this issue that was resolved. However since rebuilding
I previously had a table that is created using hibernate entities. I am using
I have an application that uses CoreData. I previously had a class named Marker
Previously we had desktop applications but given the fact that accessing the server (either
previously i had custom tableviewcell and was loading from Nib.in that i have specified
I'm using TortoiseSVN. I had previously been working with only one subfolder of a
In my DllRegisterServer method of my COM dll, I previously had code that called
Previously in ext 3.0 we had Tree Panel built from XML response. For that
I previously had Passenger 2.2.13 install with NGINX 0.7.65 - I want to install
I have a follow-up question regarding an issue I previously had on SO here

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.