I was working on Android Studio for adding a short toast message.(I was making an Android Wear Application)
I couldn\'t know why this code has error on \'symbol R\'
I resolved it by editing my build.gradle file.
build.gradle
The compiledSdkVersion must align with your appcompat dependency.
compiledSdkVersion
appcompat
My compileSdkVersion was 22 so I edited my appcompat dependency to
compileSdkVersion
compile 'com.android.support:appcompat-v7:22.2.1'
So, I hope this can be a solution.