File tree Expand file tree Collapse file tree 1 file changed +42
-1
lines changed
Expand file tree Collapse file tree 1 file changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,48 @@ public class App extends Application {
5959` Cockroach.uninstall(); `
6060
6161
62- 装载Cockroach后点击view抛出异常和new Handler中抛出异常捕获到的堆栈如下可以看到都已经被 ` at com.wanjian.cockroach.Cockroach$1.run(Cockroach.java:47) ` 拦截,APP没有任何影响,没有闪退,也没有重启进程
62+ 装载Cockroach后点击view抛出异常和new Handler中抛出异常
63+
64+ ``` java
65+
66+
67+ findViewById(R . id. but1). setOnClickListener(new View .OnClickListener () {
68+ @Override
69+ public void onClick (View v ) {
70+ throw new RuntimeException (" click exception..." );
71+ }
72+ });
73+
74+ findViewById(R . id. but2). setOnClickListener(new View .OnClickListener () {
75+ @Override
76+ public void onClick (View v ) {
77+ new Handler (). post(new Runnable () {
78+ @Override
79+ public void run () {
80+ throw new RuntimeException (" handler exception..." );
81+ }
82+ });
83+ }
84+ });
85+
86+ findViewById(R . id. but3). setOnClickListener(new View .OnClickListener () {
87+ @Override
88+ public void onClick (View v ) {
89+ new Thread () {
90+ @Override
91+ public void run () {
92+ super . run();
93+ throw new RuntimeException (" new thread exception..." );
94+ }
95+ }. start();
96+ }
97+ });
98+
99+
100+ ```
101+
102+ 捕获到的堆栈如下,可以看到都已经被 ` at com.wanjian.cockroach.Cockroach$1.run(Cockroach.java:47) ` 拦截,APP没有任何影响,没有闪退,也没有重启进程
103+
63104``` html
64105
6510602-15 11:25:16.940 29873-29873/wj.com.fuck W/System.err: java.lang.RuntimeException: click exception...
You can’t perform that action at this time.
0 commit comments