Why this type casting?

前端 未结 2 1987
情歌与酒
情歌与酒 2021-01-14 08:21

I am using an intent to start another activity, and making my intent carry some data as an extra to the newly created activity. I am following a tutorial to do that.

2条回答
  •  自闭症患者
    2021-01-14 08:50

    findViewById returns a View. If you need to use methods of a derived class you need to cast. If you need to use only the methods of the base class you can avoid the cast

提交回复
热议问题