Hello group.
I'm fighting with the facebook sdk and have hit a (for me) brick wall. The
protected void onActivityResult(int requestCode, int resultCode, Intent data) activity method needs to be overrrided in our activity, so i've put this code :
that compiles & runs (I get the facebook login page), but doesn't give the expected results. In the log i see
I know that i should use requestCode somewhere, but can't find any place in the facebookSdk to use it. So, does anyone know a workaround for this situation ?
TIA
Nelson
I'm fighting with the facebook sdk and have hit a (for me) brick wall. The
protected void onActivityResult(int requestCode, int resultCode, Intent data) activity method needs to be overrrided in our activity, so i've put this code :
B4X:
@ShortName("fbGlue")
@ActivityObject
public static class fbGlue{
private IOnActivityResult ion;
int requestCode;
public void Initialize(BA ba) {
ion = new IOnActivityResult() {
@SuppressWarnings("unchecked")
@Override
public void ResultArrived(int resultCode, Intent intent) {
Log.d("B4A","Result Arrived");
}
};
BA pBa = ba.processBA;
if (pBa == null) {
pBa = ba;
Log.d("B4A","pba was null");
} else {
Log.d("B4A","pba was not null");
}
try {
pBa.startActivityForResult(ion, null); //<-- passing null instead of an intent
Log.d("B4A","first pass");
}
catch (NullPointerException npe) {
//required...
Log.d("B4A","NPE");
}
BA.SharedProcessBA sba = pBa.sharedProcessBA;
try {
Field f = BA.SharedProcessBA.class.getDeclaredField("onActivityResultCode");
f.setAccessible(true);
requestCode = f.getInt(sba) - 1;
Log.d("B4A","" + requestCode);
//requestCode holds the value that should be used to send the intent.
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
that compiles & runs (I get the facebook login page), but doesn't give the expected results. In the log i see
B4X:
onActivityResult: wi is null
I know that i should use requestCode somewhere, but can't find any place in the facebookSdk to use it. So, does anyone know a workaround for this situation ?
TIA
Nelson