I have a code module which implements viewpager with navigation drawer, however, when I run the code I get the following error
01-26 09:20:02.958: D/AndroidR
I am a new to Android App development. I faced this error and spend almost 5 hours trying to fix it. Finally, i found out the following was the root cause for this issue and if anyone to face this issue again in the future, please give this a read.
I was trying to create a Home Activitiy with a Video Background, for which i had to change the parent theme from the default setting of Theme.AppCompat.Light.DarkActionBar to Theme.AppCompat.Light.NoActionBar. This worked fine for the Home Activity, but when i set a new button with a onclicklistener to navigate to another Activity, where i had set a custom text to the Action Bar, this error is thrown.
So, what i ended up doing was to create two themes and assigned them to the activities as follows.
Theme.AppCompat.Light.DarkActionBar - for Activities with Action Bar (default)
Theme.AppCompat.Light.NoActionBar - for Activities without Action Bar
I have made the following changes to make fix the error.
Defining the themes in styles.xml
Associating the Activities to their Respective Themes in AndroidManifest.xml