Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By mine0926

Thread: Could somebody help me? please

  1. #1
    mk726 is offline Member
    Join Date
    Mar 2012
    Posts
    1
    Rep Power
    0

    Default Could somebody help me? please

    This is my first android project an i was following a tutorial on youtube and i got this random error (which is probabily very simple).

    package your.first.project;

    import android.app.Activity;
    import android.os.Bundle;
    import android.widget.Button;

    public class firstprojectActivity extends Activity {
    /** Called when the activity is first created. */
    Button buttonPlay;

    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    buttonPlay - (Button) findViewById (R.id.play);

    }
    }

    The error that eclipse is giving me a syntex error for "-" (in the bold line). how do i fix this?

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: Could somebody help me? please

    What is that line supposed to do?

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default Re: Could somebody help me? please

    Moved from New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    5

    Default Re: Could somebody help me? please

    I think you are assigning "play" from layout to btnPlay so you should use equal sign and NOT minus sign.
    jwolf likes this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •