Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"intellij idea" debug static class

I have the following code in my android project I develop using "intellij idea":

Settings.Secure.putInt(this.getContentResolver(),Settings.Secure.ADB_ENABLED, 1);

I have break point next to this line, and when I stop here unfortunately I can not see Static fields of Settings class. I have tried:

Class g1 = Settings.class;

But can not see internals of that class anyway.

What to change in "intellij idea" settings to see those Static fields.

like image 971
Larva Avatar asked Mar 05 '14 15:03

Larva


People also ask

How do I debug a class in IntelliJ?

Run the program in debug modeClick the Run icon in the gutter, then select Modify Run Configuration. Enter arguments in the Program arguments field. Click the Run button near the main method. From the menu, select Debug.

Can we debug class file in IntelliJ?

IntelliJ IDEA provides a debugger for Java code. Depending on the installed/enabled plugins, you can also debug code written in other languages. During a debugging session, you launch your program with the debugger attached to it.

How do I show debugging in IntelliJ?

By default, the Debug tool window opens when your program hits a breakpoint and is not hidden when the session is terminated. To change this behavior, clear the Show debug window on breakpoint checkbox on the Build, Execution, Deployment | Debugger page of the IDE settings Ctrl+Alt+S .


1 Answers

When you hit a breakpoint, in the Debugger tab of your debug instance, right-click on any variable, then choose Customize Data Views and make sure Static field (and Static final fields, depending on your needs) are checked.

See https://www.jetbrains.com/idea/webhelp/customize-data-views.html for more info.

like image 161
Bastien Jansen Avatar answered Sep 29 '22 11:09

Bastien Jansen