In Android Studio, we are getting a deprecated warning during the build. This code is in onCreate(Bundle) of an Activity
String databasePath = webView.getContext().getDir("databases", Context.MODE_PRIVATE).getPath();
webSettings.setDatabaseEnabled(true);
webSettings.setDatabasePath(databasePath);
The method has these annotations
@SuppressLint("SetJavaScriptEnabled")
@SuppressWarnings("deprecation")
@TargetApi(19)
@Override
public void onCreate(Bundle savedInstanceState) {
I know setDatabasePath is deprecated, but we need this for backwards compatibility.
I thought that would hide the warning. When we do the compile task, I see a message like
.../app/src/main/java/com/.../WebframeActivity.java Warning:(106, 15) [deprecation] setDatabasePath(String) in WebSettings has been deprecated
I thought the @SuppressWarnings annotation would not report this as a warning. What can I do? Is this a bug or am I overlooking my mistake?