Originally Posted by perseus0807
Hullo, you lot. I was working on my own xposed module - and I had a bit of a question. Assuming I'm hooking into a function that's a member of a nested class, how do I refer to objects in the outer class? Here's what I'm trying to hook into - initContentView is a member function of the class ActionPopupWindow, which is inside the outer class Editor. I'm trying to access mTextView - a TextView defined within Editor, not ActionPopupWindow.
Any suggestions? Cheers
Use XposedHelpers.getSurroundingThis(...), something like:
Object outerObject = XposedHelpers.getSurroundingThis(param.thisObject);
Object fieldValue = XposedHelpers.getObjectField(outerObject, "mTextView");
However, for the specific case you mention I don't think this is what you need. mTextView isn't defined on the Editor class but rather on PinnedPopupWindow, which is also an inner class and a superclass of ActionPopupWindow.
getObjectField() is aware of fields on superclasses and will fetch it for you just by using: