After going through several posts I figured out I could send the intent with the following line of code (second line used for debugging):
int ret = system("am broadcast -a android.intent.action.MIKE_ACCESSED --user 0");
__android_log_print(ANDROID_LOG_DEBUG, "gxp18", "Shell command returned %i", ret);
Unfortunately, this returns always (No matter what is the command used in the system("...")):
Shell command returned 32512
Interestingly, I can successfully send the intent through adb using:
adb shell am broadcast -a android.intent.action.MIKE_ACCESSED
Aucun commentaire:
Enregistrer un commentaire