So I'm trying to hook OnActivityResume
using Xposed. This is one part of my code in after hook:
ArrayList<View> views = new ArrayList<View>();
listViews(views, rootView);
Log.d("ViewListing", Integer.toString(views.size()));
for(Iterator<View> i = views.iterator(); i.hasNext(); ) {
final View item = i.next();
Log.d("ViewListing", "View:" + item.getClass().getName() + ":" + Boolean.toString(item instanceof android.support.v7.widget.Toolbar));
if(item.getClass().getName().equals("android.support.v7.widget.Toolbar")) {
Log.d("ViewListing", "Found Toolbar!");
Drawable d = (Drawable) XposedHelpers.getObjectField(item, "mBackground");
Log.d("ViewListing", "And background?" + d);
}
}
The toolbar is found, but the drawable is null
. (My goal is to get the background color)