Skip to content
Advertisement

TextView cannot be cast to EditText

First time posting a question to this site so I might make some mistakes!

I’m new to programming and getting the following error when running an application in Android Studio:

JavaScript

The code that’s causing this issue is

JavaScript

I’ve tried to delete the R.java files and clean the project but it didn’t work, any help solving the problem would be greatly appreciated 🙂

I can add any other files or relevant code that might be a factor in the problem.

Edit: After changing the code from text view to edit text I’m getting a new error.

Logcat:

JavaScript

The xml file, activity_note_editor:

JavaScript

The file that’s giving the error, NoteEditorActivity:

JavaScript

Mainactivity.java:

JavaScript

Advertisement

Answer

In your xml, change

JavaScript

to

JavaScript

Hope this helps.

Edit:

You didn’t put ‘text’ in the intent. 🙂

Try changing

JavaScript

to

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement