Java.lang.Override is deprecated in android

Inspection info: Reports where deprecated code is used in the specified inspection scope.

The app runs fine in android studio, no problem, but the question arises why java.lang.Override is deprecated.

The warning shows when the mouse hovers over it.

How to solve Java.lang.Override is deprecated  method in android studio.

This problem is found in some projects, which means when you start a new project or open an old project in the android studio, you will get this warning Java.lang.Override is deprecated.

Don’t worry if your android studio getting this type of warning. Here given a simple method to resolve in a few seconds.

When does this warning appear?

Java.lang.Override is deprecated this warning you will get when you mouse hovers over override.

Java.lang.Override is deprecated in android

When you run your app, does not found issue. App run as normal, but why this Java.lang.Override is deprecated warning shows.

So let’s try to resolve Java.lang.Override is deprecated issue in android.

How to resolve Java.lang.Override is deprecated in android studio?

Solving this issue is not so difficult, but beginners do not understand it. So this tutorial is helpful for those people who have started a new android studio app development practice and face this type of problem

When you click on “more” then you will get more info about this warning, likewise “Inspection info: Reports where deprecated code is used in the specified inspection scope”.

Click on any java code blank area.

then, press the “Shift key” two times. The search box will appear.

Type “annotations.xml(java/lang)” in the search box.

You can see three-line like this

<root>
<item name ‘java.lang.Override’ >
<annotation name=’java.lang.Deprecated’/>
</item>
</root>

Comment all lines as shown below code

<!--<root>-->
<!--<item name ‘java.lang.Override’ >-->
<!--<annotation name=’java.lang.Deprecated’/>-->
<!--</item>-->
<!--</root>-->

After this, comment out all the lines, go to your java class file, and remove your java.lang.Override, the warning is removed.

Leave a Reply