Ambiguous method call. And findViewById (int) in AppCompactActivity and Activity

I refer to this link Error: ambiguous method call. And findViewById (int) in AppCompactActivity and Activity to solve, but there is no android.app.Activity import, and also if I convert my android.support.v7.app.AppCompatActivity import to android.app.Activity, then there will be an error, but I I want to use AppCompatActivity.

I am also updating all the libraries in the SDK, as well as being invalid and rebooting, but nothing works.

why does this error occur and how to solve it?

+6
source share
2 answers

I think you have something like this

ViewClass view = (ViewClass)findViewById(R.id.view);

, API? ,

ViewClass view = findViewById(R.id.view); // without redundant cast

findViewById API 25, . SDK

0

API 26, /, gradle.

0

All Articles