Opening facebook app on specified profile page

后端 未结 7 1068
温柔的废话
温柔的废话 2020-12-24 14:20

I\'m trying to use some code from SO but it fails:

Those are uri\'s supposed to open the right section of the app.

facebook://facebook.com/info?user=         


        
相关标签:
7条回答
  • 2020-12-24 15:18

    Is this not easier? For example within an onClickListener?

    try { 
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/426253597411506"));
        startActivity(intent);
    } catch(Exception e) {
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.facebook.com/appetizerandroid")));    
    }   
    

    PS. Get your id (the large number) from http://graph.facebook.com/[userName]

    0 讨论(0)
提交回复
热议问题