api-impl: fixes for apps using old support library

This commit is contained in:
Julian Winkler
2024-09-27 15:11:00 +02:00
parent 64c5ebe5b6
commit 98e7989ccb
8 changed files with 20 additions and 3 deletions

View File

@@ -84,6 +84,7 @@ public class LayoutInflater {
context = new ContextThemeWrapper(context, themeResId);
}
ta.recycle();
constructor.setAccessible(true);
View view_instance = (View)constructor.newInstance(context, attrs);
return view_instance;

View File

@@ -67,4 +67,6 @@ public interface MenuItem {
public CharSequence getTitleCondensed();
public CharSequence getTitle();
public MenuItem setNumericShortcut(char numericChar);
}

View File

@@ -97,7 +97,7 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
// Reusing removeView in removeViewInLayout is not possible, because e.g.
// ViewPager overrides removeView to call removeViewInLayout
protected void removeViewInternal(View child) {
if (child.parent != this)
if (child == null || child.parent != this)
return;
child.parent = null;
children.remove(child);