0
votes

I'm trying to make a button open options for other social networking apps that they may possibly have on their phone but I didn't include on my social networking page in my App, and this is what I have so far

    options.setOnClickListener(new OnClickListener(){
        @Override
        public void onClick(View v){
            Intent othersIntent = new Intent(android.content.Intent.ACTION_VIEW);
            startActivity(Intent.createChooser(othersIntent, "Choose"));
        }
    });

Now what this currently does is bring up a scrollable screen full of different apps, but they include things like network options, music hub, com.sec.android.app.kieswifi ... and just things that I don't think people will be needing.

So my question: is there anyway to specify what type of apps show up in this scrollable screen full of apps?

1

1 Answers

0
votes

For sharing text Intent intent=new Intent(android.content.Intent.ACTION_SEND); intent.setType("text/plain"); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);

// Add data to the intent, the receiving app will decide what to do with it.
intent.putExtra(Intent.EXTRA_SUBJECT, “Some Subject data”);
intent.putExtra(Intent.EXTRA_TEXT, “Body of the message”);

... and starting it with a chooser:

startActivity(Intent.createChooser(intent, “Share via”));

For image

shareIntent.setType("image/*");

// For a file in shared storage.  For data in private storage, use a ContentProvider.
Uri uri = Uri.fromFile(getFileStreamPath(pathToImage));
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);