java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener

I upgraded my android studio to 2.1.3. And now I am getting following error java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener(Landroid/view/View;Landroid/support/v4/view/OnApplyWindowInsetsListener;)V in class Landroid/support/v4/view/ViewCompatLollipop; or its super classes (declaration of ‘android.support.v4.view.ViewCompatLollipop’ appears in /data/data/com.restroshop.restroowner/files/instant-run/dex/slice-internal_impl-24.2.0_7c318f8d2adb03d07a9def5d35a14e39204ecef2-classes.dex) at android.support.v4.view.ViewCompat$LollipopViewCompatImpl.setOnApplyWindowInsetsListener(ViewCompat.java:1619) at android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(ViewCompat.java:2924) at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:425) at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:312) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:277) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at com.restroshop.restroowner.splash.SplashScreen.onCreate(SplashScreen.java:65) at android.app.Activity.performCreate(Activity.java:6033) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) at […]

Is there any Android api to find/sense room temperature programmatically in android code?

I am developing an android app for my project, I need to find room temperature as part of it. I am using Droid 2 A955 model for testing. My Questions are: What sensors need to be available in my Android phone to perform this temperature sensing task? Can Ambient Light Sensor (available in Droid 2) […]

Android: OpenCV: imwrite always returns false and fails to write

This code used to work but on Android 4.2 and OpenCV 2.4.4 it fails, but I don’t know why. Can anyone shed any light on it for me? Thanks for any help. Baz public void SaveImage (Mat mat) { Mat mIntermediateMat = new Mat(); Imgproc.cvtColor(mRgba, mIntermediateMat, Imgproc.COLOR_RGBA2BGR, 3); File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); String filename = […]

Highlight selected item inside a RecyclerView

I’m having trouble with highlighted an item within a RecyclerView, similar to setting the selected item in a ListView. At the moment, I’ve set up up the RecyclerView, have a default LayoutManager, and have an adapter which displays all the data. I’ve just recently got the onClickListener() working (although I’m not sure if it should […]

How do I determine whether a path is a local file or not

Given just a location as a string, is there a reliable way to determine if this is a local file (such as /mnt/sdcard/test.jpg) or a remote resource (such as http://www.xyz.com/test.jpg)? Converting it to a Uri with Uri.parse doesn’t seem to give me anything to indicate where the file is. I don’t really want to have […]

Uncaught TypeError when using a JavascriptInterface

I’m currently displaying a bunch of data to the user as HTML in a webview. I have some links below each entry that should call a method in my app when clicked. The Android WebView’s javascript interface seems to be the best (only?) way of handling these things. However, whenever I click the link, I […]

I have updated Android SDK to rev. 22 yesterday and there is no apkbuilder in tools

I have checked with my friend who has Android SDK tools version 21, the apkbuilder is there. I have updated the Android SDK tools to version 22 and I can’t find apkbuilder anymore. So it seems that the Andorid SDK tool has replace the apkbuilder with something else? How can I make ant build.xml without […]

Android: programmatically change the application label?

It doesn’t seem possible, but I was hoping someone may be aware of a way. Can the label of the application (the one defined in the manifest file by android:label=”@string/app_name”) be set from code?

Gmail “Can't attach empty file”

My app creates a PDF using iText library (template PDF with forms which are filled) and I want to then attach it to an email to send. When I try to attach the file I get the error Can’t attach empty file in the Gmail app. Have also tried with the HTC email app and […]

Resigning system.img on a device

I am working on an automatic app updating solution for devices (LG p509 – Optimus 1) which we deploy to our customers. We have control of these devices and currently install a custom kernel on them (but not a full custom ROM). Since we are trying to do auto-updating of our app on the device, […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.