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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:48:46+00:00 2026-06-05T03:48:46+00:00

I am having a problem with my app, I cannot figure out what the

  • 0

I am having a problem with my app, I cannot figure out what the problem is. On ICS the app works, but on anything 2.X it has problems. I believe it has to do with the loop but I am still a bit confused.

Developer console throws this at me for the error report:

Exception class > java.lang.StackOverflowError
Source method > Matrix.setScale()

This is the code that is causing the problem…

private void shiftLoop7()
{
    if (d7 != doy && d7 < 366)
    {
        d7 = d7 + 8;
        shiftLoop7();
    }
    else if(d7 == doy)
    {

        if (hour >= 0 && hour < 8)
        {
            shift.setText("C");
            shift.setTextAppearance(getApplicationContext(), R.style.CShift);

            shiftImage.setImageResource(R.drawable.c);
            timeTill.setText("till 7:45 AM");

            dayshift.setText("A Shift");
            day1.setBackgroundResource(R.color.A);
            day2.setBackgroundResource(R.color.A);
            day3.setBackgroundResource(R.color.A);
            day4.setBackgroundResource(R.color.A);

            nightshift.setText("C Shift");
            night1.setBackgroundResource(R.color.C);
            night2.setBackgroundResource(R.color.C);
            night3.setBackgroundResource(R.color.C);
            night4.setBackgroundResource(R.color.C);
        }
        else if (hour >= 8 && hour < 17)
        {
            shift.setText("A");
            shift.setTextAppearance(getApplicationContext(), R.style.AShift);

            shiftImage.setImageResource(R.drawable.a);
            timeTill.setText("till 4:45 PM");

            dayshift.setText("A Shift");
            day1.setBackgroundResource(R.color.A);
            day2.setBackgroundResource(R.color.A);
            day3.setBackgroundResource(R.color.A);
            day4.setBackgroundResource(R.color.A);

            nightshift.setText("C Shift");
            night1.setBackgroundResource(R.color.C);
            night2.setBackgroundResource(R.color.C);
            night3.setBackgroundResource(R.color.C);
            night4.setBackgroundResource(R.color.C);
        }
        else
        {
            shift.setText("C");
            shift.setTextAppearance(getApplicationContext(), R.style.CShift);

            shiftImage.setImageResource(R.drawable.c);
            timeTill.setText("till 7:45 AM");

            dayshift.setText("A Shift");
            day1.setBackgroundResource(R.color.A);
            day2.setBackgroundResource(R.color.A);
            day3.setBackgroundResource(R.color.A);
            day4.setBackgroundResource(R.color.A);

            nightshift.setText("C Shift");
            night1.setBackgroundResource(R.color.C);
            night2.setBackgroundResource(R.color.C);
            night3.setBackgroundResource(R.color.C);
            night4.setBackgroundResource(R.color.C);
        }
    }
    else
    {
        shiftLoop8();
    }
}
  • 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-05T03:48:47+00:00Added an answer on June 5, 2026 at 3:48 am

    A common cause of stack overflow is a large number of recursive calls – either due to a bug causing infinite recursion, or code that is just structured to have very deep recursion.

    In your case, the stack overflow may be caused by the fact that your code has potential for a fairly large depth of recursive calls. Could you restructure the recursive calls to just be while loops? For example, instead of:

    if (d7 != doy && d7 < 366)
    {
        d7 = d7 + 8;
        shiftLoop7();
    }
    

    could you just do the following:

    while (d7 != doy && d7 < 366)
    {
        d7 = d7 + 8;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems like an extremely easy problem but alas I cannot figure it out
I'm having a problem with building my iPhone app..so, i finally finished it, but
i am having no problem at all compiling/debugging my web app, but when i
Im trying to make an app with geoDjango but I'm actually having some problem
Im having a problem with my app that causes it to crash when no
i'm having problem to deal with charset in ruby on rails app, specificially in
Hy everyone. I am having this problem with my app: If i let it
Having this problem with my android app I struggled with this for some time
I'm having a problem with my web app (JSF+JPA). I deploy it on Glassfish
Im having a problem opening the settings preferences in my IOS iphone app. At

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.