src/android/Serializer.java
/** Convert an intent to JSON.
     *
     * This actually only exports stuff necessary to see file content
     * (streams or clip data) sent with the intent.
     * If none are specified, null is return.
     */
Convert an intent to JSON.
This actually only exports stuff necessary to see file content
(streams or clip data) sent with the intent.
If none are specified, null is return.
Convert an intent to JSON . This actually only exports stuff necessary to see file content ( streams or clip data ) sent with the intent . If none are specified null is return .
public static JSONObject toJSONObject(
            final ContentResolver contentResolver,
            final Intent intent)
            throws JSONException {
        JSONArray items = null;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            items = itemsFromClipData(contentResolver, intent.getClipData());
        }
        if (items == null || items.length() == 0) {
            items = itemsFromExtras(contentResolver, intent.getExtras());
        }
        if (items == null) {
            return null;
        }
        final JSONObject action = new JSONObject();
        action.put("action", translateAction(intent.getAction()));
        action.put("exit", readExitOnSent(intent.getExtras()));
        action.put("items", items);
        return action;
    }
public static JSONObject toJSONObject ( final ContentResolver contentResolver , final Intent intent ) throws JSONException { JSONArray items = null ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . KITKAT ) { items = itemsFromClipData ( contentResolver , intent . getClipData ( ) ) ; } if ( items == null || items . length ( ) == 0 ) { items = itemsFromExtras ( contentResolver , intent . getExtras ( ) ) ; } if ( items == null ) { return null ; } final JSONObject action = new JSONObject ( ) ; action . put ( "action" , translateAction ( intent . getAction ( ) ) ) ; action . put ( "exit" , readExitOnSent ( intent . getExtras ( ) ) ) ; action . put ( "items" , items ) ; return action ; }
Convert an intent to JSON.
Convert an intent to JSON .