I don't know if you have this error. Right-click --> New --> Android project --> Create project from existing source, select the example below sample for import, and R will not be found. java file also prompts that match_parent is invalid.
I found some explanations on the Internet. After experiment, I found that I could do this:
1. During the first import, select another version of build target. If the base fails, it will change to a higher value. After the import, you will find that the match_parent is invalid. Don't worry. Check your R. java, right?
2. Delete the project you just imported. Note: Do not delete the local file. Then import the SDK, but this time you will need to break the SDK where the example is located. For example, if I import the notepad example in asamples \ Android-8, select Android 2.2, and then finish, how about R. if Java does exist, match_parent will not prompt that it is invalid?
Check that match_parent is a layout that was created only in version 2.2. Therefore, the SDK Before Version 2.2 will prompt that it is invalid!