I got the following crash report when use a wrappered library , but I can't work out what might of caused it. any help or hint? thanks!
the wrapper code:
B4X:
java.lang.RuntimeException: Unable to start activity ComponentInfo{b4a.example/top.nicelee.purehost.MainActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f0b001c
the wrapper code:
B4X:
@Version(1.0f)
@Permissions(values={"android.permission.INTERNET"})
@ShortName("PureHostLib")
@ActivityObject
public class B4AWrapperClass extends AbsObjectWrapper<MainActivity> {
@Hide
public static BA ba;
@Hide
public static String eventName;
private static MainActivity cv;
private IOnActivityResult ion;
Intent intent;
Context context;
public void Initialize(BA paramBA, String paramString) {
eventName = paramString.toLowerCase(BA.cul);
BA.Log("eventName:" +eventName );
ba = paramBA;
MainActivity cv = new MainActivity();
String str = paramString.toLowerCase(BA.cul);
BA.Log("str:" +str );
setObject(cv);
intent = new Intent(BA.applicationContext, MainActivity.class);
BA.Log("intent:" +intent );
int layoutId = BA.applicationContext.getResources().getIdentifier("activity_main", "layout", BA.packageName);
BA.Log("layoutId_activity_main:" +Bit.ToHexString(layoutId) );
int resourceId = BA.applicationContext.getResources().getIdentifier("activity_main", "id", BA.packageName);
BA.Log("resourceId_activity_main:" +Bit.ToHexString(resourceId) );
}
public Intent GetIntent()
{
return intent;
}
public void setContentView(BA pBA, String LayoutName){
pBA.activity.setContentView(BA.applicationContext.getResources().getIdentifier(LayoutName, "layout", BA.packageName));
}
}
Attachments
Last edited: