I see a Lint error
Call requires API level 11 (current min is 9)
for the following files in v7_appcompat lib:
android:attr/borderlessButtonStyle in notification_media_action.xml
android:attr/borderlessButtonStyle in notification_media_cancel_action.xml
android:attr/dividerHorizontal in notification_template_big_media_narrow.xml
android:attr/dividerHorizontal in notification_template_big_media.xml
What can I do?
Related
I'm trying to disable multi window support using android:resizeableActivity="false" inside application tag in the manifest file. But it shows this warning -
Attribute resizeableActivity is only used in API level 24 and higher (current min is 15)
Then I used "suppress with tool:TargetApi Attribute". This gave me RuntimeException: Worker exited due to exception:
What should I do now ?
Attribute resizeableActivity is only used in API level 24 and higher (current min is 15)
You can safely ignore that warning because Multi Window Support is only available from Android 7.0(API level 24) and above. On lower versions this line android:resizeableActivity="false" will simply be ignored.
I am using HttpCookie, CookieManager, CookieStore classes in my project but as they are available only in API level 9. As soon as I changed to api level8, I am getting lint errors. Please let me know what is the alternative.
Call requires API level 9 (current min is 8): java.net.HttpCookie#getName
Making a program for Android L' using pdfrenderer the issue is
when 'm running the emulator with minsdk = 21
ERROR - "emulator-5554 disconnected! Cancelling 'com.example.andro_pdf_two.MainActivity activity launch'!"
when 'm trying to run the emulator at minsdk = 19
ERROR at logcat- java.lang.NoClassDefFoundError: android.graphics.pdf.PdfRenderer
and Call requires API level 21 (current min is 19): android.graphics.pdf.PdfRenderer#openPage
I have done everything as suggested - resetting adb, resetting preferences...but nothing seems to be working can anyone help???
Call requires API level 21 (current min is 19): android.graphics.pdf.PdfRenderer#openPage
clearly states that you need a min sdk version of 21 and your app has a current api level of 19
set this in your manifest and try
<uses-sdk android:minSdkVersion="21" />
PDFRenderer assumes minimum API level - 21.
You can use android-pdfview for API level less than 21.
I'm quite new with Android development, and I wanted to learn a bit about Lint tool and NewApi check. After doing some tests I'm a bit confused though.
After creating new Android application project in IntelliJ IDEA, I added some code to the onCreate method, so it now looks like this:
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Display d = getWindowManager().getDefaultDisplay();
Point size = new Point();
d.getSize(size); // API level 13
isDestroyed(); // API level 17
NativeActivity nativeActivity = new NativeActivity(); // API level 11
nativeActivity.getContentResolver(); // API level 11
Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); // API level 9
boolean canDisableShutterSound = cameraInfo.canDisableShutterSound; // API level 17
}
In the manifest file I have
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="17" />
After compiling the project and running lint from command line:
lint --check NewApi --classpath c:\_dev\TestNewApi\out c:\_dev\TestNewApi
I got the following output:
Scanning TestNewApi: .......
out\production\TestNewApi\com\example\TestNewApi\MyActivity.class: Error: Call requires API level 9 (current min is 7): android.app.NativeActivity#getContentResolver [NewApi]
out\production\TestNewApi\com\example\TestNewApi\MyActivity.class: Error: Call requires API level 9 (current min is 7): new android.app.NativeActivity [NewApi]
out\production\TestNewApi\com\example\TestNewApi\MyActivity.class: Error: Call requires API level 9 (current min is 7): new android.hardware.Camera.CameraInfo [NewApi]
out\production\TestNewApi\com\example\TestNewApi\MyActivity.class: Error: Field requires API level 9 (current min is 7): android.hardware.Camera.CameraInfo#canDisableShutterSound [NewApi]
4 errors, 0 warnings
So no complaints about getSize and isDestroyed methods. And after changing minSdkVersion to 9, the check result is:
Scanning TestNewApi: .......
No issues found.
It looks for me, like only the classes are checked in both cases, and if the class was introduced at or after minSdkVersion, then everything is ok. Is this the expected behavior? Or maybe I'm missing something?
Is this the expected behavior?
IMHO, no. I see the same behavior in Eclipse, and IMHO this is a bug. Normally, Lint will complain about methods that are newer than your android:minSdkVersion or #TargetApi(). I'm not quite certain why it is not doing that here.
I have filed an issue related to this.
What does Advanceable Added in API level 16 mean? And how to use those two methods in Advanceable Api?I saw this interface in Launcher source code. I am not clear about the specification in android docs.Thanks.
It means that only devices with api level 16 or above knows/can use that method/class. And will fail to run if you put the code under a device with api level 15 or lower.