'Intent cannot be resolved to a type' error in eclipse

回眸只為那壹抹淺笑 提交于 2020-01-09 11:11:11

问题


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

How do I fix it?


回答1:


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;


来源:https://stackoverflow.com/questions/11804112/intent-cannot-be-resolved-to-a-type-error-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!