ViewGroup: prevent NotFoundException caused by log message

This commit is contained in:
Julian Winkler
2025-01-11 17:50:21 +01:00
parent 1aba1c901d
commit 54aaa42d86
2 changed files with 2 additions and 2 deletions

View File

@@ -685,7 +685,7 @@ public final class AssetManager {
*/ */
/*package*/ native final int getResourceIdentifier(String name, String type, String defPackage); /*package*/ native final int getResourceIdentifier(String name, String type, String defPackage);
/*package*/ /*native*/ final String getResourceName(int resid) { public /*native*/ final String getResourceName(int resid) {
String name = getResourcePackageName(resid); String name = getResourcePackageName(resid);
String type = getResourceTypeName(resid); String type = getResourceTypeName(resid);
if (type != null) if (type != null)

View File

@@ -359,7 +359,7 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
public void setClipToPadding(boolean clipToPadding) {} public void setClipToPadding(boolean clipToPadding) {}
public View findViewById(int id) { public View findViewById(int id) {
Slog.v(TAG, "findViewById: looking for id: " + String.format("%x", id) + "(" + getResources().getResourceName(id) + ")" + " | checking: " + this + ",id: " + String.format("%x", this.getId()) + ", id_str: " + this.getIdName()); Slog.v(TAG, "findViewById: looking for id: " + String.format("%x", id) + "(" + getResources().getAssets().getResourceName(id) + ")" + " | checking: " + this + ",id: " + String.format("%x", this.getId()) + ", id_str: " + this.getIdName());
if (this.id == id) { if (this.id == id) {
Slog.v(TAG, "findViewById: found: "+this+" | id: " + String.format("%x", this.getId()) + ", id_str: " + this.getIdName()); Slog.v(TAG, "findViewById: found: "+this+" | id: " + String.format("%x", this.getId()) + ", id_str: " + this.getIdName());
return this; return this;