-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDebugger.java
65 lines (54 loc) · 859 Bytes
/
Debugger.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import java.util.Set;
public class Debugger {
public static void i(Object obj) {
String s = obj.toString();
Log.i("#I", s);
}
public static void intentInfo (Intent i) {
String str = String.format
(
""
+ ".\n"
+ "Intent Info"
+ "\n\n"
+ "%s"
+ "\n\n\n"
,
i.toString()
.replaceAll
(
"(.{3}=.+?) ",
"$1\n\n"
)
.replaceFirst
(
"\\{\\s",
"{\n"
)
.replaceFirst
(
"\\s\\}$",
"\n}"
)
);
Bundle bundle = i.getExtras();
if (bundle != null)
{
Set<String> keys = bundle.keySet();
str += "Extras:\n\n";
for (String key : keys)
{
str += String.format
(
"%s:\n%s\n\n",
key,
bundle.get(key)
);
}
}
i(str);
}
}