Error:(43, 35) error: no suitable method found for findViewById(TextView) method Activity.findViewById(int) is not applicable (argument mismatch; TextView cannot be converted to int) method AppCompatActivity.findViewById(int) is not applicable (argument mismatch; TextView cannot be converted to int)找到findViewById(TextView的)沒有合適的方法
爲什麼在該代碼發生這樣的錯誤:
lblName = (TextView) findViewById(lblName);
lblEmail = (TextView) findViewById(lblEmail);
它不是垃圾郵件的我problam – NewDev
前恰到好處R.id?對於活動,你需要調用'setContentView()'和Fragment,你需要使用由'onViewCreated()'返回的LayoutView:'returnedLayout.findViewById(...)' – rupinderjeet
我正在使用活動。 – NewDev