Sign in to follow this  
flamman

Add Sync To "share" Menu (Android)

Recommended Posts

Syncing an image works fine on my Android smartphone, when from inside the Sync app I add and select a file. I'd prefer if I could do the same from inside my Gallery. So when I look at a picture I want to sync, I do not need to remember the filename, but I can tap the little "share" icon and Sync is included in the list of apps, alongside Twitter, Facebook, Gmail or Whatsapp.

Edited by flamman

Share this post


Link to post
Share on other sites

It doesn't need much work..

Something like this already does it:

#In a ("NameOfMyActivity") Activity file:Intent intent = getIntent();Bundle extras = intent.getExtras();String action = intent.getAction();if (Intent.ACTION_SEND.equals(action)) {    if (extras.containsKey(Intent.EXTRA_STREAM)) {        Uri uri = (Uri) extras.getParcelable(Intent.EXTRA_STREAM);                #do something with it (in this case print the path of the file to be shared to the screen)        Toast.makeText(this, "Selected File :" + uri.toString(), Toast.LENGTH_LONG).show();    }}#In the AndoidManifest:<activity android:name="NameOfMyActivity">    <intent-filter>        <action android:name="android.intent.action.SEND"></action>        <data android:mimeType="*/*"></data>        <category android:name="android.intent.category.DEFAULT"></category>    </intent-filter></activity>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this