Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select target API in the Android Studio layout design preview

My application targets API 17 but the min Sdk version is the 8. In the layout design preview page I can se how my layout appears on an API 17 version, but if I click on the API selector drop down menu, I can't choose any other API level. Obviousely I can run my application in a 2.3 Android version and on a real device I can see the result, but is there a way to test in also in the design preview page?

My manifest snippet:

    <uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

a little screen from the Android Studio

like image 928
Santacrab Avatar asked May 17 '13 16:05

Santacrab


1 Answers

UPDATE

Actually I found out what the problem was: when you install Android Studio, by default it uses its own Android SDK (located in the Android Studio.app/sdk folder), instead of the ones you downloaded (for example to use with Eclipse).

So I simply had a misalignement between the SDK I thought I was using and the ones I was actually using. To solve this you have 2 options:

-from Android Studio select File -> Project Structure. Under "platform settings" you can add your (updated) downloaded SDK folder and use it for your projects.

-open the Android Studio SDK manager and install also the older android versions SDKs

like image 148
Santacrab Avatar answered Sep 30 '22 11:09

Santacrab