# Oh No, APwidgets again

**URL:** <https://discourse.processing.org/t/oh-no-apwidgets-again/1064>\
**Category:** Processing for Android\
**Created:** [June 19, 2018, 12:01am UTC](https://discourse.processing.org/t/oh-no-apwidgets-again/1064 "2018-06-19T00:01:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HackinHarry](https://avatars.discourse-cdn.com/v4/letter/h/3e96dc/32.png) [@HackinHarry](https://discourse.processing.org/u/HackinHarry)\
**Post date:** [June 19, 2018, 12:01am UTC](https://discourse.processing.org/t/oh-no-apwidgets-again/1064/1 "2018-06-19T00:01:56Z")

</div>

I am trying to add buttons(APwidgets) and stuff to my app that is built on processing for android. I got it to upload to my tablet using the android mode processing3, but it crashed. I exported it so I could tweak it in Android Studio. It still crashes but I get a little more info as to what is going wrong.

Heres the message:

java.lang.NoSuchMethodError: No virtual method runOnUiThread(Ljava/lang/Runnable;)V in class Lprocessing/core/PApplet; or its super classes (declaration of ‘processing.core.PApplet’ appears in /data/app/processing.test.apwidgetstext-1/base.apk)

I’d like to fix the problem, but I don’t understand it. I’ll modify the source for APwidgets if I know where to start. Thanks for any clues.

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [June 19, 2018, 12:10am UTC](https://discourse.processing.org/t/oh-no-apwidgets-again/1064/2 "2018-06-19T00:10:14Z")

</div>

There is recently involvement of one community member to get APwidgets going again: [Using Sound in Android](https://discourse.processing.org/t/using-sound-in-android/762)

However, the owner of the repo might not be around supporting this project anymore. If you want to add buttons, have you consider using Android widgets instead? Check these:

> [On-screen buttons without APWidgets? - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/14206/on-screen-buttons-without-apwidgets)  
> [Creating Native Android Menus in Processing Android Mode - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/18606/creating-native-android-menus-in-processing-android-mode)

Give it a try. it is not that difficult. at least, it is easier than modifying the APwidget source code.

Kf

---

<div class="post-metadata">

**Author:** ![HackinHarry](https://avatars.discourse-cdn.com/v4/letter/h/3e96dc/32.png) [@HackinHarry](https://discourse.processing.org/u/HackinHarry)\
**Post date:** [June 22, 2018, 10:12pm UTC](https://discourse.processing.org/t/oh-no-apwidgets-again/1064/3 "2018-06-22T22:12:20Z")

</div>

Thank You, @kfrajer I tried it and the second link(buttons without APwidgets) is really helpful. Now I need to expand on that so pressing a button does something. My gut says I need to know how to start and stop threads. Press a button and one thread runs, press another and it stops and a different one starts.

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [June 23, 2018, 8:03am UTC](https://discourse.processing.org/t/oh-no-apwidgets-again/1064/4 "2018-06-23T08:03:51Z")

</div>

@HackinHarry===  
no; you have only to add a listener to the button:

monBouton.setOnClickListener(new OnClickListener() {  
@Override  
public void onClick(View view) {

```
  //what you want
        
    }
});
```
