error: cannot find symbol variable EXTRA_MESSAGE in Android Studio

  • Replies:3
  • OpenNot stickiedUnanswered
  • Forum posts: 1

Dec 26, 2014 2:23:14 PM via Website

I was following 'Building Your First App' tutorial in developer.android.com

to create an edit text button for reading a text and then displaying that text in another activity, i used the exact code they provided there in my android studio project, but i'm getting 2 errors in MyActivity.java and DisplayMessageActivity.java, one error each for these java files.

error: cannot find symbol variable EXTRA_MESSAGE, why this error, pls help me to solve this.

  • Forum posts: 1

Oct 3, 2016 1:01:19 AM via Website

It's already there. I had the same issue. In the item 'Build an Intent' it's included. Not in the previous step. That's the problem with the copy and paste thing. Part of the learning proces ;-)

  • Forum posts: 1

Apr 26, 2017 9:05:52 AM via Website

The general causes for a Cannot find symbol error are things like:

  • Incorrect spelling.
  • Wrong case. Halo is different from halo.
  • Improper use of acceptable identifier values (letters, numbers,
    underscore, dollar sign), my-class is not the same as myclass.
  • No variable declaration or variable is outside of the scope you are
    referencing it in.

Eldo