# ControlP5 buttons issue Android

**URL:** <https://discourse.processing.org/t/controlp5-buttons-issue-android/30779>\
**Category:** Processing for Android\
**Created:** [June 18, 2021, 1:13pm UTC](https://discourse.processing.org/t/controlp5-buttons-issue-android/30779 "2021-06-18T13:13:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmuylle](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@mmuylle](https://discourse.processing.org/u/mmuylle)\
**Post date:** [June 18, 2021, 1:13pm UTC](https://discourse.processing.org/t/controlp5-buttons-issue-android/30779/1 "2021-06-18T13:13:28Z")

</div>

A test sketch consists of two ControlP5 buttons. When run in Java mode, the buttons behaves as expected, a click immediately generates a response text. However, in Android mode, one has to click twice to get the response text. The second click may be anywhere on the screen or even the other button. How can I avoid this mess.

// libraries  
import controlP5.\*;

PFont font;

// make controllers  
ControlP5 cP5;  
Button but\_A;  
Button but\_B;  
Textlabel tlb\_A;  
Textlabel tlb\_B;

void settings() {  
fullScreen();  
}

void setup() {  
imageMode(CENTER);  
font = createFont(“Georgia”,40);  
cP5 = new ControlP5(this);  
cP5.setFont(font);

// make button A  
but\_A = cP5.addButton(“A”)  
.setPosition(width/2 - 150, height/2 - 500)  
.setSize(120,120)  
;

// make button B  
but\_B = cP5.addButton(“B”)  
.setPosition(width/2 + 150, height/2 - 500)  
.setSize(120,120)  
;

// make textlabel A  
tlb\_A = cP5.addLabel(“t\_A”)  
.setText(“Button A”)  
.setPosition(width/2 - 150, height/2 - 300)  
.setColor(color(#FF0318))  
;  
tlb\_A.hide();

// make textlabel A  
tlb\_B = cP5.addLabel(“t\_B”)  
.setText(“Button B”)  
.setPosition(width/2 + 150, height/2 - 300)  
.setColor(color(#FF0318))  
;  
tlb\_B.hide();  
}

void A() {  
println(“Button A Pressed”);  
tlb\_A.show();  
tlb\_B.hide();  
}

void B() {  
println(“Button B Pressed”);  
tlb\_B.show();  
tlb\_A.hide();  
}

void draw() {  
background(255);  
}

```auto

```

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [June 18, 2021, 9:04pm UTC](https://discourse.processing.org/t/controlp5-buttons-issue-android/30779/2 "2021-06-18T21:04:34Z")

</div>

read this

# [Solving touch issue](https://discourse.processing.org/t/solving-touch-issue/28152)
