+ Reply to Thread
Results 1 to 2 of 2

Thread: How to Edit Chooser Screen ?

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    13

    How to Edit Chooser Screen ?

    Code:
    String message = "Text I want to share";
    Intent share = new Intent(Intent.ACTION_SEND);
    share.setType("text/plain");
    share.putExtra(Intent.EXTRA_TEXT, message);
    startActivity(Intent.createChooser(share,"Share on"));
    right now it shows the default options like: Bluetooth, Email, Facebook, Gmail, LinkedIn, Messaging, Share Via Barcode.

    or are these the installed apps?

    what i want is to know, how i can remove few from this list. like i want to remove Share Via Barcode.

    and add something else?

    Thank You

  2. #2
    Junior Member
    Join Date
    Aug 2012
    Posts
    16
    Use below code to add a new Item to the Chooser Screen.

    Code:
    Intent share = new Intent(Intent.ACTION_SEND);
    share.setType("text/plain");       
    share.putExtra(Intent.EXTRA_TEXT, message);
    
    Intent addIntent = ;//whatever you want
    
    Intent chooser = new Intent(Intent.ACTION_CHOOSER);
    chooser.putExtra(Intent.EXTRA_INTENT, share );      
    chooser.putExtra(Intent.EXTRA_TITLE, "title");
    
    Intent[] intentArray =  {addIntent }; 
    chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentArray);
    startActivity(chooser);
    But removing specific items is not possible. So you could resolve the intent using Packagemanager.resolveActivity and create your own custom list view

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts