问题
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