Why not connect the button click event to a function EX

 

public void onClick(View v) {

Toast.makeText(Num.this, stringFunction(),Toast.LENGTH_SHORT).show();

}

 

Public string stringFunction(){

If(whatever){

Return = "Hello";

}

 

 

}

 

 

From: android-developers@googlegroups.com
[mailto:android-developers@googlegroups.com] On Behalf Of TreKing
Sent: Wednesday, February 22, 2012 3:22 PM
To: android-developers@googlegroups.com
Subject: Re: [android-developers] Re: Button for dynamic text

 

On Wed, Feb 22, 2012 at 2:13 PM, Pram <goodp...@gmail.com> wrote:

when I try to use return in my if statement that does not work the tv
statements do not show anything on the screen when it is executed.


The code in your original post is extremely hard to read. Try a smaller
snippet that illustrates what you're talking about.

 

Have you put in logging and used your debugger to step through and see what
the code is doing?

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

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to