Qpython OL:无法在 makeIntent() 中将类型 org.json.JSONArray 转换为 JSONObject

问题描述

我正在尝试在 Qpython OL 中使用 androidhelper 和下面的代码进行意图:

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
)

但是我遇到了以下错误:

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

此外,我没有找到任何有效的 android.makeIntent() 示例。有人可以帮忙吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)