我编程的第一个安卓教程在eclipse中,并编写本code时:
I am programming the first android tutorial in eclipse, and when compiling this code:
Intent intent = getIntent();
它给人的错误
it gives the error
意图不能被解析为一个类型
Intent cannot be resolved to a type
如何解决呢?
也许,进口
语句丢失。尝试pressing 控制 + 移 + 0 ,Eclipse会自动如果缺少添加import语句。
Probably, the import
statement is missing. Try pressing Ctrl+Shift+O, Eclipse will automatically add the import statement if missing.
再来看一下文件的顶部,看看已被添加。它应该是这样的:
Then look at the top of the file and see what has been added. It should be something like this:
import android.content.Intent;