1. Are you ready for the Galaxy S20? Here is everything we know so far!

Issues with registerlink.setOnClickListener(new View.OnClickListener(){

Discussion in 'Android Development' started by Ronicus, Jul 17, 2017.

  1. Ronicus

    Ronicus Lurker
    Thread Starter

    I am getting an error in android developer from this piece of code and cant figure out how to fix it i was following direction from a youtube tutorial

    I have pasted the code here https://pastebin.com/iCGCQ1Ur

    here is the youtube tutorial




    [​IMG]

     


  2. Best Answer:
    Post #13 by Deleted User, Jul 17, 2017 (3 points)

    1. Download the Forums for Android™ app!


      Download

       
  3. Deleted User

    Deleted User Guest

    What's the error?
     
  4. Ronicus

    Ronicus Lurker
    Thread Starter

    #3 Ronicus, Jul 17, 2017
    Last edited: Jul 17, 2017
  5. Ronicus

    Ronicus Lurker
    Thread Starter

    Delete this please
     
  6. Ronicus

    Ronicus Lurker
    Thread Starter

  7. Deleted User

    Deleted User Guest

    You're missing a semi-colon at line 45. Should be

    Code (Text):
    1.  
    2. };
    3.  
     
  8. Ronicus

    Ronicus Lurker
    Thread Starter

    Any idea what the issue is in my screenshot ?
     
  9. Deleted User

    Deleted User Guest

    Actually that should be

    Code (Text):
    1.  
    2. });
    3.  
     
  10. Deleted User

    Deleted User Guest

    Yes, it's a syntax error in your code. See above for correct code.
     
  11. Ronicus

    Ronicus Lurker
    Thread Starter

    I fixed it and it still shows me the same error on this

    its this part that shows an error
    View.OnClickListener
     
  12. Deleted User

    Deleted User Guest

    Mate, can you just type in the line. The compiler is getting really confused because you have not completed the statement. It sees that you declare an anonymous class instance as a parameter to a method, but you have not given the closing ';' character. Until it sees that it can make no sense of the entire block of code starting at line 40.
     
  13. Ronicus

    Ronicus Lurker
    Thread Starter

    I hate to be such a pain but I did that and im still left like this i just took this screenshot

    https://ibb.co/cX31VF
     
  14. Deleted User

    Deleted User Guest

    Yes I see, you've typed "OnClick", and it should be "onClick".
    Java is very picky and that includes case sensitivity.
     
  15. Ronicus

    Ronicus Lurker
    Thread Starter

    Ahh your amazing thank you :)
     
    Deleted User likes this.
Loading...

Share This Page

Loading...