add missing Context attribute to all View constructors

This commit is contained in:
Julian Winkler
2023-07-14 18:02:04 +02:00
parent 151eb334cc
commit 6b79adb2c3
12 changed files with 46 additions and 26 deletions

View File

@@ -35,12 +35,12 @@ public class LayoutInflater {
public final View createView(String name, String prefix, AttributeSet attrs) throws Exception {
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>> createView(" + name + ", " + prefix + ", " + attrs + ");");
String view_class_name = prefix + name;
String view_class_name = prefix!=null ? prefix + name : name;
Class view_class = Class.forName(view_class_name);
Constructor constructor = view_class.getConstructor(AttributeSet.class);
Constructor constructor = view_class.getConstructor(Context.class, AttributeSet.class);
View view_instance = (View)constructor.newInstance(attrs);
View view_instance = (View)constructor.newInstance(Context.this_application, attrs);
return view_instance;
}