Can someone tell me where should i set a try/catch to catch this?
02-10 22:54:35.701: E/ActivityThread(787): Failed to find provider info for com.facebook.katana.provider.PlatformProvider
I already know that it is caused because I have not installed the facebook application in the cellphone.
I want to make a Toast when the exception is throwed this do not work.
shareButton.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
try{
FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(Archivo.this)
.setLink(pagina)
.setName(nombre)
.setPicture(photo)
.setDescription(brief)
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
}
catch(FacebookDialogException ex){
int duration = Toast.LENGTH_SHORT;
CharSequence FacebookDialogError="Instale y actualize su version de Facebook";
Toast toast = Toast.makeText(activity,FacebookDialogError , duration);
toast.show();
}
}
});
I set te same toast in where the facebookdialog receive a exception and it still not working.
public FacebookDialog build() {
validate();
Bundle extras = new Bundle();
putExtra(extras, NativeProtocol.EXTRA_APPLICATION_ID, applicationId);
putExtra(extras, NativeProtocol.EXTRA_APPLICATION_NAME, applicationName);
Intent intent = handleBuild(extras);
if (intent == null) {
int duration = Toast.LENGTH_SHORT;
CharSequence FacebookDialogError="Instale y aCtualize su version de Facebook";
Toast toast = Toast.makeText(activity,FacebookDialogError , duration);
toast.show();
throw new FacebookException("Unable to create Intent; this likely means the Facebook app is not installed.");
}
appCall.setRequestIntent(intent);
return new FacebookDialog(activity, fragment, appCall, getOnPresentCallback());
}
What should I do to make a Toast of that exception?