At the moment I'm writing a module for the Xposed framework but now I have a problem. I want to inflate a layout from my own package. I thought I can do this by using this code:
Context context = (Context) XposedHelpers.getObjectField(object, "mContext");
LayoutInflater inflater = LayoutInflater.from(context);
View buttons = inflater.inflate(R.layout.volumebuttons, null, false);
But this does not work. When it comes to the third line an exception is thrown (sorry for this unclear formulation. I do not realy know what a kind of exception is thrown - I can't see it with the Xposed framework). Do you have any ideas why I can't use this code to inflate my layout?