2

I used the code that I found in this page Open a facebook page from android app?

    facebookButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            try {

                getPackageManager().getPackageInfo("com.facebook.katana", 0);
                Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/[page_id]"));
                startActivity(intent);
            } catch(Exception e) {
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.facebook.com/[page_name]")));
            }
        }
    });

But, if facebook is not open in background, when I click the button the facebook app opens itself in homepage. If facebook is in background, I see the right page.

How could I open the right page even facebook is not in background?

Thanks :)

Community
  • 1
  • 1
MadLefty
  • 72
  • 4

0 Answers0