How to crash an Android app programmatically?

后端 未结 13 1495
遥遥无期
遥遥无期 2021-02-05 00:37

I want to test out crash report using acra but the first step is I need to simulate a fatal crash in Android using code.

Any idea?

13条回答
  •  梦如初夏
    2021-02-05 00:50

    Simply create in your main.xml a button like this:

     

    then run your app and click for crash

提交回复
热议问题