I created a new Android project, targeting API 15 and using androidx
. The autogenerated Hello world
is:
package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Adding import androidx.webkit.WebViewAssetLoader
to it fails with Cannot resolve symbol webkit
.
So I tried to create another project, this time targeting API level 27, with the same result, and I concluded that the API I needed was 28 (and gave up because I do not want to target something so restricting). Someone commenting on another question suggested that is not the case, hence this question, which is twofold.
Where can one find which API level a particular class targets? The documentation on WebViewAssetLoader does not say.
Am I missing something in my project, e.g. additional JARs which are optional?