0

Hy guys.... is there any way to load facebook inside a webview without the blue menu bar?

thanks !!

6r0pius
  • 65
  • 8

1 Answers1

1

First this seems a bad idea. Might even be against their TOS. This is what the Facebook api is for.

Let us know what you want to achieve, there maybe a better way to do what you are after (Using facebook api for example ?)

Actual answer

The facebook page needs your user to be logged in. Once that is achieved, simply load the page in a httpclient or get the html using the infamous javascript hack( how to get html content from a webview? ). Then parse the html, remove what you feel is unnecessary for your use and load this in the webview using loadData.

You will have to intercept shouldoverrideurlloading from your WebView's WebViewClient to make sure you catch every page changes and scrape your html accordingly.

Again sounds like a difficult to achieve bad idea in general.

Community
  • 1
  • 1
Yahel
  • 8,522
  • 2
  • 24
  • 32
  • I know it seems a bad idea, and now I saw your answer, a very difficult one. The thing is that what I'm loading in the webview is a fanpage, and I just want the user to see that... not to let him navigate facebook. That's why is unnecesary the blue bar. – 6r0pius Sep 03 '12 at 19:11
  • Well if it is a fan page it is a lot less difficult actually. You do not need to manage a login session. I see you are new here. Don't forget to accept answers when they help you or nobody will help you further. Good luck. – Yahel Sep 04 '12 at 08:38
  • yes, I'm new at everything... even with android development... thanks for everything but this seems too hard for me... maybe I should leave it – 6r0pius Sep 04 '12 at 13:00