Android:Facebook与内容分享链接(Android : Facebook share link with content)
我正在尝试与android中的内容分享链接。 我想在Android eclipse中使用它。
我在Android Studio中试过,它运行得很好。
编译'com.facebook.android:facebook-android-sdk:4.6.0'
if (ShareDialog.canShow(ShareLinkContent.class)) { ShareLinkContent linkContent = new ShareLinkContent.Builder() .setContentTitle("How to share content") .setImageUrl(Uri.parse("https://www.numetriclabz.com/wp-content/uploads/2015/11/114.png")) .setContentDescription("simple LinkedIn integration") .setContentUrl(Uri.parse("https://www.numetriclabz.com/android-linkedin-integration-login-tutorial/")) .build(); shareDialog.show(linkContent); // Show facebook ShareDialog }
此代码在Android Studio中完美运行。
当我在eclipse中尝试这个时它不起作用。 我为FacebookSDK库添加了库,但是“ ShareLinkContent ”没有在eclipse中导入
谁能帮帮我吗
I am trying to share a link with content in android. I want this in Android eclipse.
I tried in Android Studio, it was working perfectly.
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
if (ShareDialog.canShow(ShareLinkContent.class)) { ShareLinkContent linkContent = new ShareLinkContent.Builder() .setContentTitle("How to share content") .setImageUrl(Uri.parse("https://www.numetriclabz.com/wp-content/uploads/2015/11/114.png")) .setContentDescription("simple LinkedIn integration") .setContentUrl(Uri.parse("https://www.numetriclabz.com/android-linkedin-integration-login-tutorial/")) .build(); shareDialog.show(linkContent); // Show facebook ShareDialog }
this code is working perfectly in Android Studio.
When I try this in eclipse it is not working. I add the library for FacebookSDK library , but the "ShareLinkContent" is not importing in eclipse
can any one please help me
原文:https://stackoverflow.com/questions/38449695
最满意答案
查看XMLHttpRequest: http : //www.google.com/search? sourceid = chrome&ie = UTF-8&q = XHR
和Ajax: http : //en.wikipedia.org/wiki/Ajax_ (programming)基本上:创建XMLHttpRequest,
打开你的.php,
发送(null)和中提琴,你已经完成了。XHR的作用是,它在后台请求页面并在后台加载它。 这就是你所需要的一切。
如果您需要页面的内容,您应该查看XHR.onreadystatechange和XHR.responseText
Look into XMLHttpRequest: http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=XHR
and Ajax : http://en.wikipedia.org/wiki/Ajax_(programming)Basically: create an XMLHttpRequest,
open your .php,
send(null) and viola, you're done.What XHR does, is it requests the page in the background and loads it in the background. Thats pretty much all you need.
If you need the content of the page, you should look into XHR.onreadystatechange and XHR.responseText
相关问答
更多-
您需要使用AJAX来处理PHP代码并返回结果。 这是使用jQuery的AJAX处理程序的选项: # File: yourform.html