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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:42:33+00:00 2026-06-12T10:42:33+00:00

I have built a test application in Android with minimum API level as 8

  • 0

I have built a test application in Android with minimum API level as 8 in which I want to implement the following :

I have a toggle button which looks somewhat like this :

enter image description here

This as you know is the default design of toggle buttons in API level 8.
But I want my UI to be adaptive to the API level the application is running in. So in case the same app is running on Ice Cream Sandwhich (API level 15) , the same toggle button should look like this :

enter image description here

Does android provide any means to support this feature without building different a apk for each API level?

  • 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-12T10:42:34+00:00Added an answer on June 12, 2026 at 10:42 am

    Edit

    • You need to work with sdk level 16 (or the latest), so the Switch
      class will be recognized
    • set android:minSdkVersion to 8 in the
      manifest
    • work with folders like stated below:

    You have to use different layout that you will put in different layout folder.

    For the api level 8 (and above), put it in

    /res/layout-v8
    and use the ToggleButton class: http://developer.android.com/guide/topics/ui/controls/togglebutton.html

    For the level 15:

    /res/layout-v15
    and use a Switch class.

    Good readings for you: http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources

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

Sidebar

Related Questions

I have an android lib project, and an android test project i've built in
I have built a small application in android.I have used XML pull parser to
I'm testing my android application using calabash-android which provides it's own "test project", with
I am currently trying to test the Android SDK/API, and to do so have
I have built a test app on android using this cool-ass PhoneGap framework, but
I have built part of my app and wanted to test it out. All
I have built a site which requires user to login. Now I have decided
I have built so far an application that allows the user to drag and
I want built a Android App and use Eclipse for this. It is my
I have created a database for my application. Now I want to make sure

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.