textview cannot be resolved to a type的解决方法

android程序开发中

当我们已经定义好了button,textview等控件后。在主程序引用时会出现一下警告:

textview cannot be resolved to a type

遇到这种情况我们的解决办法是:

1.手动导入所需要的类

import android.widget.Button; import android.widget.TextView; 

2.如果你不知道应该导入什么或者是嫌手动导入太烦,你还可以通过eclipse的快捷方式自动导入

Shift + Ctrl + O

posted @ 2013-05-03 22:40  馨缘6009  Views(349)  Comments(0)    收藏  举报