You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
Resources + LayoutInflater: throw same Exceptions as on AOSP
This commit is contained in:
@@ -82,15 +82,19 @@ public class LayoutInflater {
|
||||
return view;
|
||||
}
|
||||
|
||||
public View inflate(int resource, ViewGroup root) throws Exception {
|
||||
public View inflate(int resource, ViewGroup root) {
|
||||
return inflate(resource, root, root != null);
|
||||
}
|
||||
|
||||
public View inflate(int layoutResID, ViewGroup root, boolean attachToRoot) throws Exception {
|
||||
public View inflate(int layoutResID, ViewGroup root, boolean attachToRoot) {
|
||||
|
||||
XmlResourceParser xpp = Context.this_application.getResources().getLayout(layoutResID);
|
||||
|
||||
return inflate(xpp, root, attachToRoot);
|
||||
try {
|
||||
return inflate(xpp, root, attachToRoot);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public View inflate(XmlPullParser parser, ViewGroup root, boolean attachToRoot) throws Exception {
|
||||
|
||||
@@ -115,7 +115,11 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
protected native void native_removeView(long widget, long child);
|
||||
|
||||
public View getChildAt(int index) {
|
||||
return children.get(index);
|
||||
try {
|
||||
return children.get(index);
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public int indexOfChild(View child) {
|
||||
|
||||
Reference in New Issue
Block a user