我是 Android 新手,我正在做一些关于使用各种视图的练习。一个这样的例子是:
TextView messageView = (TextView) findViewById(R.id.message);
我的问题是:投射 TextView 有什么好处?我的 IDE 告诉我强制转换方法是多余的。是否有任何用例我想以这种方式进行投射?
android casting textview
android ×1
casting ×1
textview ×1