eitan85
eitan85

Reputation: 15

Error:(19) No resource identifier found for attribute 'OnClick' in package 'android'

I trying to build app in android studio and keep getting this error I was just trying to create a OnClick event on a button in order to switch activities with an intent...i search for 2 hours for similar issues in this forum but no results yet /:

try to update the gradle dident help also..

Upvotes: 0

Views: 1082

Answers (2)

Strider
Strider

Reputation: 4490

For better answers you should post your XML..

Maybe you made some kind of spelling mistake. make sure you use

android:onClick   // <-- Lower case "o"

not

android:OnClick   // <-- Upper case "O"

Upvotes: 1

Jim
Jim

Reputation: 10278

You should post your XML. But I'm going to guess that you do not have this line in your XML:

xmlns:android="http://schemas.android.com/apk/res/android"

Something like this:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  tools:context=".MainActivity" />

EDIT:

In your title you posted "OnClick" and the attribute is "onClick" - then you posted your XML...

android:OnClick="OnClickHobbies"

should be:

android:onClick="OnClickHobbies"

Upvotes: 0

Related Questions