how to open Facebook page link in Facebook App if installed , and if the app is not installed open in default browser in android ??
i tried this code but its not working ??
Face.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = null;
String Facebook = dbList.get(0).getFacebook().toString();
try {
// get the Twitter app if possible
getPackageManager().getPackageInfo("com.facebook.android", 0);
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/" +Facebook));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
} catch (Exception e) {
// no Twitter app, revert to browser
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/?hl=en"));
}
startActivity(intent);
}
});