Android 类型参数t的上限视图和listview不兼容

Android 类型参数t的上限视图和listview不兼容,android,android-studio,android-layout,listview,compiler-errors,Android,Android Studio,Android Layout,Listview,Compiler Errors,初始化列表视图时出现错误findviewbyd(R.id.listview) 错误:不兼容的类型:类型不存在唯一的最大实例 具有上限的变量T ListView,视图中T是类型变量: T扩展方法findViewById(int)中声明的视图 将活动名称重命名为ListView为ListViewActivity 因为当您声明ListView ListView列表视图成为活动类型 将活动名称重命名为ListView,将其重命名为ListViewActivity。因为当您声明此ListView List

初始化列表视图时出现错误
findviewbyd(R.id.listview)

错误:不兼容的类型:类型不存在唯一的最大实例 具有上限的变量T ListView,视图中T是类型变量: T扩展方法findViewById(int)中声明的视图


将活动名称重命名为
ListView
ListViewActivity


因为当您声明
ListView ListView列表视图成为活动类型

将活动名称重命名为ListView,将其重命名为ListViewActivity。因为当您声明此ListView ListView时;listview成为活动类型。
public class ListView extends AppCompatActivity {
    ListView listview;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_list_view);

        listview = findViewById(R.id.listview);

    }
}