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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:29:24+00:00 2026-06-08T13:29:24+00:00

The loop below seems to stop short, and then restart. It is not inside

  • 0

The loop below seems to stop short, and then restart. It is not inside of another loop. The first Log call prints 36, thus the outer for loop should run 36 times. The Log call inside of the loop though, which is meant to print the number of times the loop has run, prints “0” up to “4” meaning the loop only ran 5 times. Would there be any reason for this process to start over so that the first Log call fires again, and the loop again runs through only 5 times? This occurs twice according to my Logcat output.

ArrayList<RunData_L> rdUP = t.getMyPositiveRunData();
ArrayList<RunData_L> rdDOWN = t.getMyNegativeRunData();
Log.d("rdUP size", rdUP.get(0).getMyMeasurementData().size() + "");
for (int i = 0; i < rdUP.get(i).getMyMeasurementData().size(); i++) {
   Log.d("i", i + "");
   ArrayList<BigDecimal> tempUP = new ArrayList<BigDecimal>(), tempDOWN = new ArrayList<BigDecimal>();
   for(int j = 0; j < rdUP.size(); j++) {
      tempUP.add(rdUP.get(j).getMyMeasurementData().get(i));
      tempDOWN.add(rdDOWN.get(j).getMyMeasurementData().get(i));
   }
   pdUP.add(tempUP);
   pdDOWN.add(tempDOWN);
}
  • 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-08T13:29:25+00:00Added an answer on June 8, 2026 at 1:29 pm

    I suspect as per my comment that the use of rdUP.get(j) in the inner loop is causing the problem.

    You first test to see the size of rdUP.get(i).getMyMeasurementData() in the outer loop as your bounding condition for the loop and so i runs from 0 to the size of rdUP.get(i).getMyMeasurementData().

    Your inner loop then says go through each element of rdUP and get the i th value from rdUP.get(j).getMyMeasurementData(). How do you know that the j th rdUP has enough elements to satisfy your get(i) ?

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

Sidebar

Related Questions

How do I maintain access to the i variable inside my for loop below?
I am creating UIButtons inside a loop as shown below. for(int i = 1;
The below code seems to be stuck in an infinate loop. I have to
Hello Stack i have the below code and it only seems to loop once,
The [sample] code below seems like it could be better in a loop or
I am wondering if there is a way to simplify the nested loop below.
I'm using a loop as below to render a label and editor for each
Scenerio: I have some divs populated through foreach loop like below <div id=div1><input type=hidden
The below program calculates 2 raised to the power n without using any loop,runtime
In the below code I'm trying to loop through each child node and append

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.