Reputation: 197
I'm trying to achieve the similar experience as Chrome F12 in Android App Debugging, i.e., get the resource ids of certain objects, even merrier, see their styles and event handlers,
Just tried this one: Inspect Element in Android Studio
But it didn't work, because I don't have enough rep points I cannot comment on that answer, so I have to post my question here:
Upvotes: 6
Views: 27348
Reputation: 7749
I think the question you linked is about inspection code elements, not view elements.
You can inspect the view hierarchy using the Android Device Monitor. Just select Hierarchy View from the perspectives. Source: http://developer.android.com/tools/help/hierarchy-viewer.html
As of Android Studio 3.1 or later, Hierarchy Viewer is deprecated. You should instead use Layout Inspector to inspect your app's view hierarchy at runtime. View -> Tool Windows -> Layout Inspector.
Upvotes: 4
Reputation: 1208
For the inspect element in android studio you can use "Evaluate expression". Just select the piece of expression you want to inspect and right click on it and select Evaluate Expression. Have a look at the image below:
This will open you a new floating window and you can see what is the value of that expression during while debugging.
Upvotes: 2