Note that there are some explanatory texts on larger screens.

plurals
  1. POShortcuts to Facebook and Twitter apps post pages
    primarykey
    data
    text
    <p>I'm implementing share functions on my Android application. I already have intergrated an intent chooser to share a text type message. Now, I'd like to create two shortcuts : one to access to the user's Facebook post page, another to access to his twitter post page. (as the chooser do)</p> <p>I found this helpful topic : <a href="https://stackoverflow.com/questions/4191492/launch-facebook-app-from-other-app">launch facebook app from other app</a> and tried to find the right word (fb://word) using the ADB shell command but I can't figure out ("publish", "publishing", "post", "share", "sharing" don't work).</p> <p>Then I tried to catch the created intent (via the Log) on the intent chooser when I was clicking on Facebook or Twitter. I found :</p> <blockquote> <p>"Starting: Intent { act=android.intent.action.SEND typ=text/plain flg=0x3000000 cmp=com.twitter.android/.PostActivity (has extras) } from pid 17575" for Facebook, and</p> <p>"Starting: Intent { act=android.intent.action.SEND typ=text/plain flg=0x3000000 cmp=com.facebook.katana/.ShareLinkActivity (has extras) } from pid 17575" for Twitter.</p> </blockquote> <p>I created those intents with the following codes (on the buttons' <code>onClick()</code> methods):</p> <pre><code>Intent fbIntent = new Intent(Intent.ACTION_SEND); fbIntent.setType("text/plain"); fbIntent.setFlags(0x3000000); fbIntent.setComponent(new ComponentName("com.facebook.katana", ".ShareLinkActivity")); fbIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.share_text)); startActivity(fbIntent); </code></pre> <p>I also tried this way:</p> <pre><code>Intent twitterIntent = new Intent(Intent.ACTION_VIEW); twitterIntent.setAction("android.intent.action.SEND"); twitterIntent.setFlags(0x3000000); twitterIntent.setType("text/plain"); twitterIntent.setComponent(new ComponentName("com.twitter.android", ".PostActivity")); twitterIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.share_text)); startActivity(twitterIntent); </code></pre> <p>But even if the logs look the same nothing happens.</p> <p>Any idea?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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