Code example for Intent

Methods: createChooserputExtrasetType

0
        actionBar.addAction(new IntentAction(this, createShareIntent(), R.drawable.ic_title_share_default));
        actionBar.addAction(new ExampleAction());
    } 
 
    private Intent createShareIntent() {
        final Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("text/plain");
        intent.putExtra(Intent.EXTRA_TEXT, "Shared from the ActionBar widget.");
        return Intent.createChooser(intent, "Share");
    } 
 
    private class ExampleAction extends AbstractAction { 
 
        public ExampleAction() { 
            super(R.drawable.ic_title_export_default); 
        } 
 
        @Override 
        public void performAction(View view) {
            Toast.makeText(OtherActivity.this,
Stop searching for code, let great code find you!  Add Codota to your java IDE