posted 7 years ago
I reproduced your code, and it runs with no problems. A few things to double check.
Check your resource layout file names are all correct, and that they are correctly written (no missing or malformed XML for example)
Check you have included your MainActivity in your manifest with the correct intent filter and activity name.
Check your API version you are using, in particular, your themes. Sometimes this can be problematic, Even if you are using the AppCompat libraries
However, it is important, as Tim Says, you need to post the Log, then we can see what's happening
If it can't be found, don't look for it