[android-developers] Re: Two functions Button?

2011-03-28 Thread harsh chandel
take a boolean variable and wirtie two if condition on each condition set condtions On Mar 27, 8:55 pm, Gabriel gab...@gmail.com wrote: How I create a button with two functions? For example, when I click it once it starts a sound, and if I click it again it stops the sounds. Or a Mute

[android-developers] Re: Two functions Button?

2011-03-27 Thread Dixi
use the even-odd logic.. like int i=1; button.onclick() { if(i%2==0) { ///operation... i++; } else { //operation i++; } } i think u got it... i hope it works - Regards Dixit Wadhwani

[android-developers] Re: Two functions Button?

2011-03-27 Thread Gabriel
It's not working Dixie. Can you put this code more clear? On 27 mar, 13:09, Dixi dixitwadhw...@gmail.com wrote: use the even-odd logic.. like int i=1; button.onclick() {        if(i%2==0)          {              ///operation...              i++;          }         else        {      

[android-developers] Re: Two functions Button?

2011-03-27 Thread Dixi
package org.dixit.com import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; public class ChangeTextValue extends Activity { /** Called when the activity is first created. */ private int i =