0

I did everything right, I guess? I saved the xml file, but have no idea how to solve this. I'm a newbie, pls help.

Here's my xml code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  >
<Chronometer
 android:id="@+id/my_chronometer"
 android:layout_gravity="center_horizontal"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
 />
<Button
 android:id="@+id/buttonstart"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="Start"
 />
<Button
 android:id="@+id/buttonstop"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="Stop"
 />
<Button
 android:id="@+id/buttonreset"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="Reset"
 />
</LinearLayout>

chronometer.java:

midhunhk
  • 5,560
  • 7
  • 52
  • 83
cgpa2.17
  • 309
  • 1
  • 3
  • 12
  • I'm not sure exactly what you're trying to do. Is Chronometer supposed to be an Activity or a View inside an activity? – Geobits Oct 11 '12 at 02:17

2 Answers2

0

The problem is with your class name I think. It has the same name as "Chronometer". This might be the cause for it. Try to replace the Activity name to something else. Maybe "chronometer" with small letter "c".

Andro Selva
  • 53,910
  • 52
  • 193
  • 240
-1

I think there is no mistake in your code, but I think you are missing the import the the Chronometer.

Please add this import in your class,

  import android.widget.Chronometer;

Good luck.

Rahul Patel
  • 3,823
  • 5
  • 30
  • 46