I want to open a Facebook profile page on my app. Instead of just opening a site, I want to open it through Facebook's official app You can say *fb:// * on an iPhone. I did that on Android There was an ActivityNotFoundException. Is there any way?
android facebook url-scheme
String facebookID = "OOOOOOOOOOOOOOOO";
try
{
Uri uri = Uri.parse( "fb://page/" + facebookID );
startActivity( new Intent( Intent.ACTION_VIEW, uri ) );
}
catch ( Exception e )
{
Intent i = new Intent( Intent.ACTION_VIEW );
Uri u = Uri.parse( "http://www.facebook.com/" + facebookID );
i.setData( u );
startActivity( i );
}
I think you can do it like this.
© 2024 OneMinuteCode. All rights reserved.