3

hi everyone i just start make an app and that error show up "" uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. "" what that mean and how can i recompile with -Xlint

my code

        import androidx.appcompat.app.AppCompatActivity;
        import android.content.Intent;
        import android.os.Bundle;
        import android.os.Handler;
        public class StartActivity extends AppCompatActivity {
        private static int timeOut = 1800;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
        final Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent i = new Intent(StartActivity.this, MainActivity.class);
                startActivity(i);
                finish();

            }
        }, timeOut);
    }
}
Ryze
  • 83
  • 1
  • 1
  • 4
  • 4
    Does this answer your question? [Recompile with -Xlint in Android studio](https://stackoverflow.com/questions/47740812/recompile-with-xlint-in-android-studio) – Martheen Aug 10 '20 at 21:57

1 Answers1

12

Let's go step by step over your problem.

  1. Deprecated means that in the future this method will no longer be supported. There might be a new method that you should use instead. This method might not be in your code but in one of the libraries that you use.

  2. Linting is process of checking in this case some additional non vital errors https://en.wikipedia.org/wiki/Lint_(software).

  3. Here are some previous questions about this topic How to recompile with -Xlint:deprecation How to add -Xlint:unchecked to my Android Gradle based project? Note: Recompile with -Xlint:deprecation for details

Also of interest might be How to show the compile error's details on Android Studio? Android Studio: Where is the Compiler Error Output Window? https://developer.android.com/studio/write/lint

Gradle is build tool which does all the steps required to build an app for you. Compiling checking lints merging etc.

This might seem like a lot but don't give up do it bit by bit. If your application is running then you can simply ignore this problem.

SecretAgentMan
  • 2,856
  • 7
  • 21
  • 41
nkhar
  • 225
  • 1
  • 4
  • 13