使用Android应用程序的用户是否可能喜欢应用程序本身在Facebook中创建的应用程序页面?
答案 0 :(得分:2)
是
只需使用WebView创建布局
喜欢
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
创建活动
Like.class
WebView webview;
Then add the following at the end of the onCreate() method:
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl(YOUR_FB_LIKE_URL);
答案 1 :(得分:1)
我有这个代码用于在墙上发布有关我的应用的信息:
protected void onClickFacebook() {
Intent i = new Intent(Intent.ACTION_VIEW);
String Url = Constants.URL_FACEBOOK;
i.setData(Uri.parse(Url));
startActivity(i);
}
我认为如果你用你喜欢的网址替换URL-facebook它也应该有效