Search code examples
androidandroid-widgetchronometer

R.layout.chronometer cannot be resolved or is not a field- android error


I tried simple stopwatch program from http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ChronometerDemo.html.

The following error is coming

"R.layout.chronometer cannot be resolved or is not a field"

I don't know how to fix it.

Thank you.


Solution

  • for this to work you must have a chronometer.xml file in your res/layout.

    here you have the source code for this file in the example