Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Share some stuff on Facebook require implementing FacebookSdk 3.0, follow this tutorial : <a href="http://www.kpbird.com/2013/03/android-login-using-facebook-sdk-30.html" rel="nofollow">http://www.kpbird.com/2013/03/android-login-using-facebook-sdk-30.html</a> </p> <p>The main goal is to provide "Login" via facebook to share something on wall. Once login works, try this method :</p> <pre><code>private void publishStory(String hash, String title, String user) { Session session = Session.getActiveSession(); if (session != null){ // Check for publish permissions List&lt;String&gt; permissions = session.getPermissions(); if (!isSubsetOf(PERMISSIONS, permissions)) { pendingPublishReauthorization = true; Session.NewPermissionsRequest newPermissionsRequest = new Session .NewPermissionsRequest(getActivity(), PERMISSIONS); session.requestNewPublishPermissions(newPermissionsRequest); return; } Bundle postParams = new Bundle(); postParams.putString("name", title); postParams.putString("caption", "By Recommend Android"); postParams.putString("description", user+" "+"STRONGLY recommends"+" "+title); postParams.putString("link", "http://re.co/"+hash); postParams.putString("picture", "http://re.co/assets/img/useful-exp.png"); Request.Callback callback= new Request.Callback() { public void onCompleted(Response response) { JSONObject graphResponse = response .getGraphObject() .getInnerJSONObject(); String postId = null; try { postId = graphResponse.getString("id"); } catch (JSONException e) { Log.i(TAG, "JSON error "+ e.getMessage()); } </code></pre> <p>Don't forget that your Html tags must be declare in your strings.xml, like this way:</p> <pre><code>&lt;string name="demoStr"&gt;&lt;Data&gt;&lt;![CDATA[ &lt;b&gt;ABC&lt;/b&gt;&lt;br /&gt; something ]]&gt; &lt;/Data&gt;&lt;/string&gt; </code></pre> <p>Then getString() will be get <code>"&lt;b&gt;ABC&lt;/b&gt;&lt;br /&gt;something"</code></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload