Below is some source code that is called from a non-static method. I get an error
"API level 23 is required for the call (current minimum is 15); android.app.Fragment # getContext"
android.content.Context context = (Context) getContext();
How to get a context object?
In explorer> Gradle Scripts> build.gradle object, I see this. Looks like version 23 for me. Am I looking in the right place?
apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { applicationId "com.example.test.test" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.2.1' compile 'com.android.support:support-v4:23.2.1' }
It looks like I have Android Studio 1.5.1. I just selected the SettingsActivity project template in Android Studio. And added one class to this standard.
android-studio android-api-levels
MacGyver Apr 20 '16 at 7:05 2016-04-20 07:05
source share