更新时间:2023-02-26 21:13:27
JSON的将是额外的字符串 com.parse.Data code>。
The JSON will be in extra string com.parse.Data
.
@Override
public void onReceive(Context context, Intent intent) {
Bundle extras = intent.getExtras();
String jsonData = extras.getString("com.parse.Data");
JSONObject jsonObject;
try {
jsonObject = new JSONObject(jsonData);
String heading = jsonObject.getString("heading");
String dataString = jsonObject.getString("dataString");
} catch (JSONException e) {
e.printStackTrace();
}
}