Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Getting my buttons to work.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dragon  
View profile  
 More options Oct 6 2012, 10:27 am
From: Dragon <2002drag...@gmail.com>
Date: Sat, 6 Oct 2012 07:27:40 -0700 (PDT)
Local: Sat, Oct 6 2012 10:27 am
Subject: Getting my buttons to work.

I have been trying for about 3-4 days trying to get my buttons to work and
I feel like an idiot because I can't seem to solve my problem.  The code
I'm showing here is from the second page of my app.  I am trying to get the
buttons to work by showing a Toast so that I can further develop it by
turning it into a counter.  First things first, getting it to work with the
toast so that I know it works.  I appreciate the help.

Here is the code:

package com.sports.discgolfou;

import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class hole_1 extends Activity implements View.OnClickListener{

@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_page2);

//TextView SC = (TextView) findViewById(R.id.labelShotCounter);
Button ButtonAdd = (Button) findViewById(R.id.buttonAdd);
ButtonAdd.setOnClickListener(this);
Button ButtonMinus = (Button) findViewById(R.id.buttonMinus);
ButtonMinus.setOnClickListener(this);
 }//End onCreate

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(v.getId() == R.id.buttonAdd)
{
Toast.makeText(this, "Hello World", Toast.LENGTH_LONG).show();

}

else if(v.getId() == R.id.buttonMinus)
{
Toast.makeText(this, "GoodBye World", Toast.LENGTH_LONG).show();
}

 }//End onClick
 }//End Activity

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Justin Anderson  
View profile  
 More options Oct 12 2012, 2:23 pm
From: Justin Anderson <magouyaw...@gmail.com>
Date: Fri, 12 Oct 2012 12:20:36 -0600
Local: Fri, Oct 12 2012 2:20 pm
Subject: Re: [android-developers] Getting my buttons to work.

Have you looked at the logcat output for any signs of errors or anything?
I don't see anything obviously wrong with your code...

You could try an anonymous class... Maybe something like this:

ButtonMinus.setOnClickListener(new View.OnClickListener() {
     @Override
     public void onClick(View v) {
          Toast.makeText(this, "GoodBye World", Toast.LENGTH_LONG).show();
     }

});

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Justin Anderson  
View profile  
 More options Oct 12 2012, 2:23 pm
From: Justin Anderson <magouyaw...@gmail.com>
Date: Fri, 12 Oct 2012 12:20:58 -0600
Local: Fri, Oct 12 2012 2:20 pm
Subject: Re: [android-developers] Getting my buttons to work.

What does the layout xml look like for these buttons?

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware

On Fri, Oct 12, 2012 at 12:20 PM, Justin Anderson <magouyaw...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TreKing  
View profile  
 More options Oct 14 2012, 4:26 am
From: TreKing <treking...@gmail.com>
Date: Sun, 14 Oct 2012 08:20:47 +0000
Local: Sun, Oct 14 2012 4:20 am
Subject: Re: [android-developers] Getting my buttons to work.

On Fri, Oct 12, 2012 at 6:20 PM, Justin Anderson <magouyaw...@gmail.com>wrote:

> Have you looked at the logcat output for any signs of errors or anything?

Also, have you set breakpoints or log messages to trace whether or not your
code is even executing?

--------------------------------------------------------------------------- ----------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »