Sunday, January 12, 2014

Re: [android-developers] How to open Google play from a shared link on Facebook?

Sorry, I missed your link in the previous thread before, but now I found it. I tried to implement according to their advice, but the link to the appstore is not included when the user tries to share the link now. I tested from a Facebook test account. Do you know how I can fix this?

They are using ACTION_VIEW, but I have to use ACTION_SEND to be able to share the link. This is my code:

 Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
 sharingIntent.setType("text/plain");
 sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Product name");
 sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, Uri.parse("market://details?id=example.package"));
 startActivity(Intent.createChooser(sharingIntent, "Share via"));  

I also tried with this code:

  Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
 sharingIntent.setType("text/plain");
  sharingIntent.setData(Uri.parse("market://details?id=morph.galaxytt"));
 startActivity(Intent.createChooser(sharingIntent, "Share via"));

This resulted in the error message "can not find the application to perform this action".

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate