Processing codes used in version 3.0, not working on version 3.3.6

edited May 5 in Android Mode

I have a previous code that works with version 3.0, and now it has build errors with 3.3.6. It says, errors have indicated below:

  1. ERROR in C:\Users\MM\AppData\Local\Temp\android8956459409649435372sketch\app\src\main\java\processing\test\processing_sw_smart_leds\Processing_Sw_Smart_LEDs.java (at line 156) startActivityForResult(requestBluetooth, 0); ^^^^^^^^^^^^^^^^^^^^^^

The method startActivityForResult(Intent, int) is undefined for the type Processing_Program

1 problem (1 error) Picked up _JAVA_OPTIONS: -Xmx512M

I could not see any error in the codes, but this error appears, and I do not know what is wrong.

Answers

  • What Android Mode version are you using?

    Create a copy of your manifest file ( a backup) and then remove it. Let processing generate a new one. After a new one is generated (by trying to run your app), make sure you revise it to add pertinent permissions.

    Kf

  • I already found the solution to the problem, it was not on the android mode version it is not even in the manifest. The code syntax I used in the processing 3.0 is

    startActivityForResult(requestBluetooth, 0);

    and this syntax worked after building, but on the processing 3.3.7, I changed the syntax to

    this.getActivity().startActivityForResult(requestBluetooth, 0);

    which by using that syntax, I was able to successfully build the app to my android device. I already experienced fixing the codes with every upgraded version of processing. From processing 2 to processing 3.0 to processing 3.3.7. I hope that this would be the last one wherein processing version upgrade won't affect previous codes. The android device and version that I used in all the versions did not change.

  • edited May 6 Answer ✓

    @myrds===

    that is not a "syntax" problem: it means only that you are in a fragment not in an activity (as it was for processing 2)...

  • Ah ok, but I do not understand why it worked with processing 3.0, but did not work with processing 3.3.7

Sign In or Register to comment.