首页 › 答案 › 题库 › 慕课 › 未分类

在Activity中需要找到一个id是bookName的TextView组件,下面那种语句写法是正确的是()。

在Activity中需要找到一个id是bookName的TextView组件,下面那种语句写法是正确的是()。
A.TextViewtv=this.findViewByID(R,id.bookName)
B.TextViewtv=(TextView)this.findViewByID(R.id.code)
C.TextViewtv=(TextView)this.findViewByID(R.id.bookName)
D.TextViewtv=(TextView)this.findViewByID(R.string.bookName)
正确答案:TextViewtv=(TextView)this.findViewByID(R.id.bookName)