Skip to content

Wrap Share Intent with Chooser #1

@danzeeeman

Description

@danzeeeman

In the java land you're just passing a basic Share Intent which throws up an option to set the default share action. This could cause a user to lock them into sharing with one app.

you could either make changes here https://github.com/ofZach/inkSpace/blob/master/srcJava/cc/openframeworks/inkSpace/OFActivity.java#L100

or here

https://github.com/ofZach/inkSpace/blob/master/srcJava/cc/openframeworks/inkSpace/OFActivity.java#L94

Or I might make the changes and do a PR.

here is some example code for popping up a Chooser

Intent sendIntent = new Intent(Intent.ACTION_SEND);
...

// Always use string resources for UI text.
// This says something like "Share this photo with"
String title = getResources().getString(R.string.chooser_title);
// Create intent to show the chooser dialog
Intent chooser = Intent.createChooser(sendIntent, title);

// Verify the original intent will resolve to at least one activity
if (sendIntent.resolveActivity(getPackageManager()) != null) {
startActivity(chooser);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions