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

SOLVED: App help

Discussion in 'Android Development' started by brggames, Sep 12, 2011.

  1. brggames

    brggames Newbie
    Thread Starter

    Howdy. Just getting into android programming and have ran into a snag. My program opens with a splash screen then goes to a menu screen with 3 buttons. The 2 buttons I've coded so far work, but the target class of one crashes. I know the buttons work because I had it go to a temp class I made and it went there fine.

    Also, when I only have the basic code in the target class it works.

    That works, but the next one does not work. It crashes.

    and here is the xml file

    Any help would be appreciated.
     

    Advertisement

  2. mills2533

    mills2533 Well-Known Member

    Remove "Button" from in front of each of the lines like this:
    Button bLeft1 = (Button) findViewById(R.id.bLeft1);

    Make it this instead:
    bLeft1 = (Button) findViewById(R.id.bLeft1);

    Because you've already declared the buttons here:
    Button bForward1, bBack1, bLeft1, bRight1, Bpause1, bPlayMusic1;
     
  3. brggames

    brggames Newbie
    Thread Starter

    Still crashes, here is the modified code

     
  4. brggames

    brggames Newbie
    Thread Starter

    I comment out the thread, switch/catch code using /* */ and it still crashes
     
  5. brggames

    brggames Newbie
    Thread Starter

    I comment out everything and it works. I doubled and tripled checked my AndroidManifest.xml, and for the life of my I can't figure it out. As I said, I'm new and may be missing something very simple. Here is the code with the stuff commented out. the menu code at the bottom works perfectly (the restar button isn't coded yet).

     
  6. brggames

    brggames Newbie
    Thread Starter

    here is the start activity code in the previous class

    and the activity code in the AndroidManifest.xml

     
  7. brggames

    brggames Newbie
    Thread Starter

    I knew it was something simple I was missing, bPlayMusic1 was an ImageButton, not a Button lol.
     
Loading...
Similar Threads - SOLVED App help
  1. KaptainKris
    Replies:
    5
    Views:
    467
  2. MoodyBlues
    Replies:
    3
    Views:
    299
  3. Adnan fiaz
    Replies:
    4
    Views:
    410
  4. MoodyBlues
    Replies:
    5
    Views:
    571
  5. AmandaxD
    Replies:
    3
    Views:
    359
  6. MrMatthew
    Replies:
    5
    Views:
    371
  7. MoodyBlues
    Replies:
    7
    Views:
    358
  8. Updog_Design
    Replies:
    5
    Views:
    356
  9. Gurinder Singh
    Replies:
    3
    Views:
    4,216
  10. MAGDEV
    Replies:
    20
    Views:
    12,137

Share This Page

Loading...