Android Studio: create a well-managed breakpoint

I just used Android Studio to create an unmodified empty Android application . I am trying to set an exception checkpoint.

By default, the default exception checkpoint runs several times. So I added !(this instance of java.lang.ClassNotFoundException) as a condition, as suggested in this question .

However, I am still interrupted by my exception , this time with a modal dialog:

Breakpoint Condition Error screenshot

How to create an exception checkpoint that will remain silent until something exceptional happens?

Edited for clarification: I do not want to make a breakpoint for a specific exception, I need a general breakpoint for the exception, which I can leave at any time.

+6
source share
2 answers

Android Studio is essentially an IntelliJ IDEA. You must use the + button in the upper left corner of the Breakpoints screen to add a breakpoint for a specific exception.

See the next section for more information: How to use Intellij Idea exception breakpoints

0
source

The key point here is to use class filters in conjunction with configuration to break down all errors by setting them to very high-level namespaces.

  • Select the Class Filters check box to enable class filtering. Then click the ... (elipsis) button to open the Class Filters dialog box.
  • Specify class namespace templates by clicking Add pattern (Add Template). Enter:

    • com.myapp.* (replace this with the namespace prefix of your application)
    • java.*
    • android.*
    • Add additional namespaces if necessary (e.g. third-party libraries)

Class filters

  1. Click OK

See details for complete instructions .

0
source

All Articles