Log get extras

pull/162/head
M66B 5 years ago
parent 9f6c179cd2
commit 7833d4a8fc

@ -309,9 +309,16 @@ public class Log {
}
static void logBundle(Bundle data) {
if (data != null) {
for (String extra : getExtras(data))
i(extra);
}
static List<String> getExtras(Bundle data) {
List<String> result = new ArrayList<>();
if (data == null)
return result;
Set<String> keys = data.keySet();
StringBuilder stringBuilder = new StringBuilder();
for (String key : keys) {
Object v = data.get(key);
@ -332,14 +339,10 @@ public class Log {
} else if (v instanceof Long)
value = "0x" + Long.toHexString((Long) v);
stringBuilder.append(key)
.append("=")
.append(value)
.append(value == null ? "" : " (" + v.getClass().getSimpleName() + ")")
.append("\r\n");
}
i(stringBuilder.toString());
result.add(key + "=" + value + (value == null ? "" : " (" + v.getClass().getSimpleName() + ")"));
}
return result;
}
static void logMemory(Context context, String message) {

Loading…
Cancel
Save