I am trying to make an intent using androidhelper
in Qpython OL with the code below:
action = "org.escpos.intent.action.PRINT"
packagename = "com.loopedlabs.escposprintservice" # target application
data = data # convert data to PDF byte array format
extras = {
'DATA_TYPE':'PDF',
'PDF_DATA' : data # raw PDF data
}
intent = droid.makeIntent( # make an intent
action = action,
packagename = packagename,
extras = extras
)
But I am having the following Error:
org.json.JSONException: Value [2,{"extras":{"DATA_TYPE":"PDF","PDF_DATA":"4"},"categories":null,"action":"org.escpos.intent.action.PRINT","flags":268435456},null] at 0 of type org.json.JSONArray cannot be converted to JSONObject
Additionally, I did not find any working example of android.makeIntent()
. Could somebody help, please?