How to display Cursor values using Debugger in Android Studio?

Asked

Viewed 135 times

1

I’m very used to just using the Logcat, while debugging an application. But I realize that the Debbuger is a much more powerful tool. I can pause the state of the application and observe its variables.

I can get the cursor position and the line count the cursor has. But I can’t find the value of each column of the database using Debugger.

Wouldn’t it be logical and possible to do this using the debbuger? If that’s not possible, why?

inserir a descrição da imagem aqui

1 answer

2


What you can see directly through Debugger, on the flap Variables, is the value of the fields of an object(variables).

The Cursor object has no field with the column values of the current position. They are obtained using methods.

The Debugger has a resource called Evaluate Expression inserir a descrição da imagem aqui which allows the calculation of Java expressions, including the call to methods.
Use it to inspect the value of each column by calling these methods.

  • 1

    You’re right, the cursor does not store column values anywhere. Just the position, column count and other things. Thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.