public static Intent getOpenFacebookIntent(Context context) {
try {
context.getPackageManager()
.getPackageInfo("com.facebook.katana", 0); //Checks if FB is even installed.
return new Intent(Intent.ACTION_VIEW,
Uri.parse("fb://profile/254175194653125")); //Trys to make intent with FB's URI
} catch (Exception e) {
return new Intent(Intent.ACTION_VIEW,
Uri.parse("https://www.facebook.com/sentiapps")); //catches and opens a url to the desired page
}
}
Bu method işini görecektir.
Intent facebookIntent = getOpenFacebookIntent(this);
startActivity(facebookIntent);
254 ile başlayan kısma kişinin profileId sini yazabilirsin.