You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For activities like turning on Bluetooth or picking a contact, developers must call startActivityForResult, and handle the result in onActivityResult.
In the following snippet, tapping the screen starts an activity to pick a contact. The system's contact picker appears, a contact can be selected (or the process cancelled), returning to the app. However, the overridden method onActivityResult never seems to be called.
(it also seems that mousePressed() isn't called if there is no draw() function)
(it also seems that mousePressed() isn't called if there is no draw() function)
You need to provide an empty draw (at a minimum) for Processing events to be handled at all. Try with draw(){ } and see if it fixes your current problem. I suggest you check the implementation of B2 in the Ketai library. There is an example there, or check Ketai.org
Thanks! I didn't post the complete sketch, but it does have an empty-bodied draw() as you suggested.
So, to clarify, mousePressed()does get called, and so doespickContact().
The main issue persists, i.e., onActivityResult() doesn't seem to be called afterwards.
I can reproduce this issue, thanks. I think the solution is to add the implementation of onActivityResult(int requestCode, int resultCode, Intent data) to the template main activity, so it calls the corresponding method in PApplet (remember that PApplet itself is not an activity).
For activities like turning on Bluetooth or picking a contact, developers must call
startActivityForResult
, and handle the result inonActivityResult
.In the following snippet, tapping the screen starts an activity to pick a contact. The system's contact picker appears, a contact can be selected (or the process cancelled), returning to the app. However, the overridden method
onActivityResult
never seems to be called.(it also seems that
mousePressed()
isn't called if there is nodraw()
function)Processing 3.3.6
Android Mode 4.0.1
Tested on:
The text was updated successfully, but these errors were encountered: