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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:15:03+00:00 2026-05-30T16:15:03+00:00

So the code is following: public static ActionBarHelper createInstance(Activity activity) { if (Build.VERSION.SDK_INT >=

  • 0

So the code is following:

public static ActionBarHelper createInstance(Activity activity) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        return new ActionBarHelperICS(activity);
    } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        return new ActionBarHelperHoneycomb(activity);
    } else {
        return new ActionBarHelperBase(activity);
    }
}

If my device is 2.3 (api 9) it shouldn’t support Build.VERSION_CODES.ICE_CREAM_SANDWICH but yet it runs, why is that? If it had been a method I called it would have crashed. Is it because it is a public static final int and therefor added from to my code? Please give some general detail and not just a yes/no answer 🙂

  • 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-05-30T16:15:06+00:00Added an answer on May 30, 2026 at 4:15 pm

    As Stefan pointed out, the api level used to compile the code determines the constants visible at compile time. For my case this doesn’t give any problems as I just compare simple values. This only give problems if you use a set method that uses different constants and you happent to use a constant that wasn’t possible to handle for your api version.

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

Sidebar

Related Questions

Considering following code public class A { public static void main(String[] args) { new
I create a new thread that runs the following code: public static void startServer()
The following code public static void main(String[] args) { fun(new Integer(1)); } static void
Given the following code: public static bool UpdateUser(string userId, string jobTitle) { return GetProvider().UpdateUser
The following code public class GenericsTest2 { public static void main(String[] args) throws Exception
I have following code: public static void ProcessStep(Action action) { //do something here if
Take the following code: public static string ReverseIt(string myString) { char[] foo = myString.ToCharArray();
I have the following code: public static T ParameterFetchValue<T>(string parameterKey) { Parameter result =
Consider the following code: public class MyClass { public static string MyStaticMethod() { //string
i have the following code: public static void Serialize() { List<string> dirs = FileHelper.GetFilesRecursive(fileDirectoryPath);

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.