1

Well I m pretty new in android,so it might be the basic question.

I just created my own button (let say "increment"). Which on being pressed increases the counter and on being released it get stop.

Sidharth
  • 11
  • 3
  • You can provide size, position,background, click event – GAMA Jun 06 '12 at 06:11
  • what do you want to ask? – Andy Jun 06 '12 at 06:13
  • Do you mean like the Date/Time Picker, where holding the button down auto-repeats? – Ken Y-N Jun 06 '12 at 06:16
  • can you please elaborate your concern? there are many people here who wanted to help you. please provide example or any illustration. – CMA Jun 06 '12 at 06:22
  • @KenY-N: Exactly my point being, lets just say i want this in button fashion not in date/time picker format. I just need a simple logic or method kind off stuffs. Example: There is a TextView = text; (2 buttons ) Button increment, decrements; now if i use increment.setOnClickListner(){ //Some stuffs,probably counter++; now if i close the statement,what will happen when i click the button "increment" the textview will display counter + 1. And i have to repeatedly hit the button to increase counter.I just it automatically, i.e. when i hit button counter increase and when i release it stop. – Sidharth Jun 06 '12 at 09:16
  • @Sidharth - [Here is a similar question with a complete answer](http://stackoverflow.com/questions/4284224/android-hold-button-to-repeat-action). Does that work for you? – Ken Y-N Jun 06 '12 at 23:07

1 Answers1

0

Do you mean if you hold the button, It will increases the counter? Implement this Android long-touch event

Community
  • 1
  • 1
Tai Tran
  • 1,406
  • 3
  • 15
  • 27
  • I just need a simple logic or method kind off stuffs. Example: There is a TextView = text; (2 buttons ) Button increment, decrements; now if i use increment.setOnClickListner(){ //Some stuffs,probably counter++; now if i close the statement,what will happen when i click the button "increment" the textview will display counter + 1. And i have to repeatedly hit the button to increase counter.I just want it automatically, i.e. when i hit button counter increase and when i release it stop. – Sidharth Jun 06 '12 at 09:11