Example usage for android.content Intent EXTRA_TITLE

List of usage examples for android.content Intent EXTRA_TITLE

Introduction

In this page you can find the example usage for android.content Intent EXTRA_TITLE.

Prototype

String EXTRA_TITLE

To view the source code for android.content Intent EXTRA_TITLE.

Click Source Link

Document

A CharSequence dialog title to provide to the user when used with a #ACTION_CHOOSER .

Usage

From source file:org.xbmc.android.remotesandbox.ui.BaseFragmentTabsActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final long start = System.currentTimeMillis();
    Log.d(TAG, "Starting onCreate()...");
    setContentView(R.layout.activity_fragment_tabs_pager);

    final HorizontalScrollView scroller = (HorizontalScrollView) findViewById(R.id.tab_scroller);
    mTabHost = (TabHost) findViewById(android.R.id.tabhost);
    mTabWidget = (TabWidget) findViewById(android.R.id.tabs);
    mViewPager = (ViewPager) findViewById(R.id.tab_pager);

    mTabHost.setup();//from w  ww  .  j av a2s  .  co  m
    mTabsAdapter = new TabsAdapter(this, mTabHost, mViewPager);

    getActivityHelper().setupActionBar(getTitle(), 0);

    final String customTitle = getIntent().getStringExtra(Intent.EXTRA_TITLE);
    getActivityHelper().setActionBarTitle(customTitle != null ? customTitle : getTitle());

    if (savedInstanceState == null) {
        onCreateTabs();
        //mFragment = onCreatePane();
        //mFragment.setArguments(intentToFragmentArguments(getIntent()));

    } else {
        mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
    }

    mTabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
        @Override
        public void onTabChanged(String tabId) {
            final int position = mTabHost.getCurrentTab();
            final View tab = mTabWidget.getChildTabViewAt(position);
            scroller.smoothScrollTo(tab.getLeft(), 0);
            mViewPager.setCurrentItem(position);
        }
    });
    Log.d(TAG, "onCreate() done in " + (System.currentTimeMillis() - start) + "ms.");

}

From source file:com.google.android.apps.iosched2.ui.DashboardFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View root = inflater.inflate(R.layout.fragment_dashboard, container);

    // Attach event handlers
    root.findViewById(R.id.home_btn_schedule).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Schedule");
            if (UIUtils.isHoneycombTablet(getActivity())) {
                //startActivity(new Intent(getActivity(), ScheduleMultiPaneActivity.class));
                startActivity(new Intent(getActivity(), Setup.ScheduleMultiPaneActivityClass));
            } else {
                //startActivity(new Intent(getActivity(), ScheduleActivity.class));
                startActivity(new Intent(getActivity(), Setup.ScheduleActivityClass));

            }/* www.j av  a 2s.c o m*/

        }

    });

    root.findViewById(R.id.home_btn_sessions).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Sessions");
            // Launch sessions list
            if (UIUtils.isHoneycombTablet(getActivity())) {
                //startActivity(new Intent(getActivity(), SessionsMultiPaneActivity.class));
                startActivity(new Intent(getActivity(), Setup.SessionsMultiPaneActivityClass));

            } else {
                final Intent intent = new Intent(Intent.ACTION_VIEW, ScheduleContract.Tracks.CONTENT_URI);
                intent.putExtra(Intent.EXTRA_TITLE, getString(R.string.title_session_tracks));
                intent.putExtra(TracksFragment.EXTRA_NEXT_TYPE, TracksFragment.NEXT_TYPE_SESSIONS);
                startActivity(intent);
            }

        }
    });

    root.findViewById(R.id.home_btn_starred).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Starred");
            // Launch list of sessions and vendors the user has starred
            //startActivity(new Intent(getActivity(), StarredActivity.class));
            startActivity(new Intent(getActivity(), Setup.StarredActivityClass));

        }
    });

    if (!Setup.FEATURE_VENDORS_ON) {
        root.findViewById(R.id.home_btn_vendors).setVisibility(View.GONE);
    }

    root.findViewById(R.id.home_btn_vendors).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Sandbox");
            // Launch vendors list
            if (UIUtils.isHoneycombTablet(getActivity())) {
                //startActivity(new Intent(getActivity(), VendorsMultiPaneActivity.class));
                startActivity(new Intent(getActivity(), Setup.VendorsMultiPaneActivityClass));

            } else {
                final Intent intent = new Intent(Intent.ACTION_VIEW, ScheduleContract.Tracks.CONTENT_URI);
                intent.putExtra(Intent.EXTRA_TITLE, getString(R.string.title_vendor_tracks));
                intent.putExtra(TracksFragment.EXTRA_NEXT_TYPE, TracksFragment.NEXT_TYPE_VENDORS);
                startActivity(intent);
            }
        }
    });

    if (!Setup.FEATURE_MAP_ON) {
        root.findViewById(R.id.home_btn_map).setVisibility(View.GONE);
    }

    root.findViewById(R.id.home_btn_map).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            // Launch map of conference venue
            fireTrackerEvent("Map");
            startActivity(new Intent(getActivity(), UIUtils.getMapActivityClass(getActivity())));
        }
    });

    if (!Setup.FEATURE_ANNOUNCEMENTS_ON) {
        root.findViewById(R.id.home_btn_announcements).setVisibility(View.INVISIBLE);
    }

    root.findViewById(R.id.home_btn_announcements).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            // splicing in tag streamer
            fireTrackerEvent("Bulletin");
            //Intent intent = new Intent(getActivity(), BulletinActivity.class);
            Intent intent = new Intent(getActivity(), Setup.BulletinActivityClass);

            startActivity(intent);
        }
    });

    return root;
}

From source file:com.lullabot.android.apps.iosched.ui.DashboardFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View root = inflater.inflate(R.layout.fragment_dashboard, container);

    // Attach click Listeners.

    // Schedule Button.
    root.findViewById(R.id.home_btn_schedule).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Schedule");
            if (UIUtils.isHoneycombTablet(getActivity())) {
                startActivity(new Intent(getActivity(), ScheduleMultiPaneActivity.class));
            } else {
                startActivity(new Intent(getActivity(), ScheduleActivity.class));
            }/*from   w  w  w. j ava 2  s. c om*/
        }
    });

    // Session Button.
    root.findViewById(R.id.home_btn_sessions).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Sessions");
            if (UIUtils.isHoneycombTablet(getActivity())) {
                startActivity(new Intent(getActivity(), SessionsMultiPaneActivity.class));
            } else {
                final Intent intent = new Intent(Intent.ACTION_VIEW, ScheduleContract.Tracks.CONTENT_URI);
                intent.putExtra(Intent.EXTRA_TITLE, getString(R.string.title_session_tracks));
                intent.putExtra(TracksFragment.EXTRA_NEXT_TYPE, TracksFragment.NEXT_TYPE_SESSIONS);
                startActivity(intent);
            }
        }
    });

    // Map Button.
    root.findViewById(R.id.home_btn_map).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Map");
            startActivity(new Intent(getActivity(), FragmentPagerSupport.class));
        }
    });

    // Tweets Button.
    root.findViewById(R.id.home_btn_tweets).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Twitter");
            startActivity(new Intent(getActivity(), TwitterStreamActivity.class));
        }
    });

    // News Button.
    root.findViewById(R.id.home_btn_news).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("News");
            startActivity(new Intent(getActivity(), NewsActivity.class));
        }
    });
    // Info Button.
    root.findViewById(R.id.home_btn_info).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("News");
            startActivity(new Intent(getActivity(), InfoActivity.class));
        }
    });

    // Sponsors Button.
    root.findViewById(R.id.home_btn_sponsors).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Sandbox");
            if (UIUtils.isHoneycombTablet(getActivity())) {
                startActivity(new Intent(getActivity(), VendorsMultiPaneActivity.class));
            } else {
                final Intent intent = new Intent(Intent.ACTION_VIEW, ScheduleContract.Tracks.CONTENT_URI);
                intent.putExtra(Intent.EXTRA_TITLE, getString(R.string.title_vendor_tracks));
                intent.putExtra(TracksFragment.EXTRA_NEXT_TYPE, TracksFragment.NEXT_TYPE_VENDORS);
                startActivity(intent);
            }
        }
    });

    // Star Button.
    root.findViewById(R.id.home_btn_starred).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Starred");
            startActivity(new Intent(getActivity(), StarredActivity.class));
        }
    });

    return root;
}

From source file:org.dmfs.tasks.EditTaskActivity.java

@TargetApi(11)
@Override//from  w  ww.j  a  va2  s  .  c  om
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_task_editor);

    mAuthority = getString(R.string.org_dmfs_tasks_authority);

    if (android.os.Build.VERSION.SDK_INT >= 11) {
        // hide up button in action bar
        ActionBar actionBar = getSupportActionBar();
        actionBar.setDisplayShowHomeEnabled(false);
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeAsUpIndicator(R.drawable.content_remove_light);
        // actionBar.setDisplayShowTitleEnabled(false);
    }

    if (savedInstanceState == null) {

        Bundle arguments = new Bundle();
        Intent intent = getIntent();
        String action = intent.getAction();

        setActivityTitle(action);

        if (Intent.ACTION_SEND.equals(action)) {

            // load data from incoming share intent
            ContentSet sharedContentSet = new ContentSet(Tasks.getContentUri(mAuthority));
            if (intent.hasExtra(Intent.EXTRA_SUBJECT)) {
                sharedContentSet.put(Tasks.TITLE, intent.getStringExtra(Intent.EXTRA_SUBJECT));
            }
            if (intent.hasExtra(Intent.EXTRA_TITLE)) {
                sharedContentSet.put(Tasks.TITLE, intent.getStringExtra(Intent.EXTRA_TITLE));
            }
            if (intent.hasExtra(Intent.EXTRA_TEXT)) {
                String extraText = intent.getStringExtra(Intent.EXTRA_TEXT);
                sharedContentSet.put(Tasks.DESCRIPTION, extraText);
                // check if supplied text is a URL
                if (extraText.startsWith("http://") && !extraText.contains(" ")) {
                    sharedContentSet.put(Tasks.URL, extraText);
                }

            }
            // hand over shared information to EditTaskFragment
            arguments.putParcelable(EditTaskFragment.PARAM_CONTENT_SET, sharedContentSet);

        } else if (ACTION_NOTE_TO_SELF.equals(action)) {
            // process the note to self intent
            ContentSet sharedContentSet = new ContentSet(Tasks.getContentUri(mAuthority));

            if (intent.hasExtra(Intent.EXTRA_SUBJECT)) {
                sharedContentSet.put(Tasks.DESCRIPTION, intent.getStringExtra(Intent.EXTRA_SUBJECT));
            }

            if (intent.hasExtra(Intent.EXTRA_TEXT)) {
                String extraText = intent.getStringExtra(Intent.EXTRA_TEXT);
                sharedContentSet.put(Tasks.TITLE, extraText);

            }

            // add start time stamp
            sharedContentSet.put(Tasks.DTSTART, System.currentTimeMillis());
            sharedContentSet.put(Tasks.TZ, TimeZone.getDefault().getID());

            // hand over shared information to EditTaskFragment
            arguments.putParcelable(EditTaskFragment.PARAM_CONTENT_SET, sharedContentSet);

        } else {
            // hand over task URI for editing / creating empty task
            arguments.putParcelable(EditTaskFragment.PARAM_TASK_URI, getIntent().getData());
            ContentSet data = getIntent().getParcelableExtra(EXTRA_DATA_CONTENT_SET);
            if (data != null) {
                arguments.putParcelable(EditTaskFragment.PARAM_CONTENT_SET, data);
            }
            String accountType = getIntent().getStringExtra(EXTRA_DATA_ACCOUNT_TYPE);
            if (accountType != null) {
                arguments.putString(EditTaskFragment.PARAM_ACCOUNT_TYPE, accountType);
            }
        }

        EditTaskFragment fragment = new EditTaskFragment();
        fragment.setArguments(arguments);
        getSupportFragmentManager().beginTransaction().add(R.id.add_task_container, fragment).commit();

    }

}

From source file:org.sufficientlysecure.keychain.util.FileHelper.java

/** Opens the storage browser on Android 4.4 or later for saving a file. */
@TargetApi(VERSION_CODES.KITKAT)//from w  ww .  j  a v a 2  s  .co  m
public static void saveDocument(Fragment fragment, String suggestedName, String mimeType, int requestCode) {
    Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
    intent.addCategory(Intent.CATEGORY_OPENABLE);
    intent.setType(mimeType);
    // Note: This is not documented, but works: Show the Internal Storage menu item in the drawer!
    intent.putExtra("android.content.extra.SHOW_ADVANCED", true);
    intent.putExtra(Intent.EXTRA_TITLE, suggestedName);
    fragment.startActivityForResult(intent, requestCode);
}

From source file:tw.idv.gasolin.pycontw2012.ui.DashboardFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View root = inflater.inflate(R.layout.fragment_dashboard, container);

    // Attach event handlers
    mScheduleButton = root.findViewById(R.id.home_btn_schedule);
    mScheduleButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Schedule");
            if (UIUtils.isHoneycombTablet(getActivity())) {
                startActivity(new Intent(getActivity(), ScheduleMultiPaneActivity.class));
            } else {
                startActivity(new Intent(getActivity(), ScheduleActivity.class));
            }/*from w ww  . jav  a  2s  . com*/

        }

    });

    root.findViewById(R.id.home_btn_sessions).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Sessions");
            // Launch sessions list
            if (UIUtils.isHoneycombTablet(getActivity())) {
                startActivity(new Intent(getActivity(), SessionsMultiPaneActivity.class));
            } else {
                final Intent intent = new Intent(Intent.ACTION_VIEW, CoscupContract.Tracks.CONTENT_URI);
                intent.putExtra(Intent.EXTRA_TITLE, getString(R.string.title_session_tracks));
                startActivity(intent);
            }

        }
    });

    root.findViewById(R.id.home_btn_starred).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Starred");
            // Launch list of sessions and vendors the user has starred
            startActivity(new Intent(getActivity(), StarredActivity.class));
        }
    });

    root.findViewById(R.id.home_btn_vendors).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Sponsors");
            // Launch vendors list
            if (UIUtils.isHoneycombTablet(getActivity())) {
                startActivity(new Intent(getActivity(), SponsorsMultiPaneActivity.class));
            } else {
                final Intent intent = new Intent(getActivity(), SponsorLevelsActivity.class);
                intent.putExtra(Intent.EXTRA_TITLE, getString(R.string.title_sponsor_levels));
                startActivity(intent);
            }
        }
    });

    root.findViewById(R.id.home_btn_announcements).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            // splicing in tag streamer
            fireTrackerEvent("Bulletin");
            Intent intent = new Intent(getActivity(), BulletinActivity.class);
            startActivity(intent);
        }
    });

    /*
     * 
     * root.findViewById(R.id.home_btn_map) .setOnClickListener(new
     * View.OnClickListener() { public void onClick(View view) { // Launch
     * map of conference venue fireTrackerEvent("Map"); startActivity(new
     * Intent( getActivity(), UIUtils.getMapActivityClass(getActivity())));
     * } });
     */

    return root;
}

From source file:org.dalmasso.ietfsched.ui.DashboardFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View root = inflater.inflate(R.layout.fragment_dashboard, container);

    // Attach event handlers
    root.findViewById(R.id.home_btn_schedule).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            HomeActivity activity = (HomeActivity) getActivity();
            if (activity.isRefreshing()) {
                Toast.makeText(activity, "Check/Upload new agenda, pls wait", Toast.LENGTH_LONG).show();
                return;
            }/*ww  w . j av a 2  s  .c o m*/
            fireTrackerEvent("Schedule");
            if (UIUtils.isHoneycombTablet(getActivity())) {
                startActivity(new Intent(getActivity(), ScheduleMultiPaneActivity.class));
            } else {
                startActivity(new Intent(getActivity(), ScheduleActivity.class));
            }
        }

    });

    root.findViewById(R.id.home_btn_sessions).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            HomeActivity activity = (HomeActivity) getActivity();
            if (activity.isRefreshing()) {
                Toast.makeText(activity, "Check/Upload new agenda, pls wait", Toast.LENGTH_LONG).show();
                return;
            }
            fireTrackerEvent("Sessions");
            // Launch sessions list
            if (UIUtils.isHoneycombTablet(getActivity())) {
                startActivity(new Intent(getActivity(), SessionsMultiPaneActivity.class));
            } else {
                final Intent intent = new Intent(Intent.ACTION_VIEW, ScheduleContract.Tracks.CONTENT_URI);
                intent.putExtra(Intent.EXTRA_TITLE, getString(R.string.title_session_tracks));
                intent.putExtra(TracksFragment.EXTRA_NEXT_TYPE, TracksFragment.NEXT_TYPE_SESSIONS);
                startActivity(intent);
            }

        }
    });

    root.findViewById(R.id.home_btn_starred).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            fireTrackerEvent("Starred");
            // Launch list of sessions and vendors the user has starred
            startActivity(new Intent(getActivity(), StarredActivity.class));
        }
    });

    root.findViewById(R.id.home_btn_announcements).setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            // splicing in tag streamer
            //                        fireTrackerEvent("Bulletin");
            Intent intent = new Intent(getActivity(), WellNoteActivity.class);
            startActivity(intent);
        }
    });
    return root;
}

From source file:net.peterkuterna.android.apps.devoxxsched.ui.TracksFragment.java

@Override
public void onListItemClick(ListView l, View v, int position, long id) {
    final Cursor cursor = (Cursor) mAdapter.getItem(position);
    final String trackId;
    final String trackName;
    final int trackColor;

    if (cursor != null) {
        trackId = cursor.getString(TracksAdapter.TracksQuery.TRACK_ID);
        trackName = cursor.getString(TracksAdapter.TracksQuery.TRACK_NAME);
        trackColor = cursor.getInt(TracksAdapter.TracksQuery.TRACK_COLOR);
    } else {/*from www  .j a va2s.c o m*/
        trackId = CfpContract.Tracks.ALL_TRACK_ID;
        trackName = null;
        trackColor = -1;
    }

    AnalyticsUtils.getInstance(getActivity()).trackEvent("Tracks", "Click",
            trackName != null ? trackName : "All Sessions", 0);

    final Intent intent = new Intent(Intent.ACTION_VIEW);
    final Uri trackUri = CfpContract.Tracks.buildTrackUri(trackId);
    intent.putExtra(SessionsFragment.EXTRA_TRACK, trackUri);
    intent.putExtra(Intent.EXTRA_TITLE, trackName);
    intent.putExtra(SessionsFragment.EXTRA_TRACK_COLOR, trackColor);

    if (cursor == null) {
        intent.setData(CfpContract.Sessions.CONTENT_URI);
    } else {
        intent.setData(CfpContract.Tracks.buildSessionsUri(trackId));
    }

    ((BaseActivity) getSupportActivity()).openActivityOrFragment(intent);

    getListView().setItemChecked(position, true);
}

From source file:com.granita.tasks.EditTaskActivity.java

@TargetApi(11)
@Override//from w w w .  j a va 2s.c om
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_task_editor);

    mAuthority = getString(R.string.org_dmfs_tasks_authority);

    //custom start
    Tracker t = ((com.granita.tasks.Tasks) getApplication())
            .getTracker(com.granita.tasks.Tasks.TrackerName.APP_TRACKER);
    t.setScreenName("Tasks: Edit task activity");
    t.send(new HitBuilders.AppViewBuilder().build());
    //custom end

    if (android.os.Build.VERSION.SDK_INT >= 11) {
        // hide up button in action bar
        ActionBar actionBar = getSupportActionBar();
        actionBar.setDisplayShowHomeEnabled(false);
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeAsUpIndicator(R.drawable.content_remove_light);
        // actionBar.setDisplayShowTitleEnabled(false);
    }

    if (savedInstanceState == null) {

        Bundle arguments = new Bundle();
        Intent intent = getIntent();
        String action = intent.getAction();

        setActivityTitle(action);

        if (Intent.ACTION_SEND.equals(action)) {

            // load data from incoming share intent
            ContentSet sharedContentSet = new ContentSet(Tasks.getContentUri(mAuthority));
            if (intent.hasExtra(Intent.EXTRA_SUBJECT)) {
                sharedContentSet.put(Tasks.TITLE, intent.getStringExtra(Intent.EXTRA_SUBJECT));
            }
            if (intent.hasExtra(Intent.EXTRA_TITLE)) {
                sharedContentSet.put(Tasks.TITLE, intent.getStringExtra(Intent.EXTRA_TITLE));
            }
            if (intent.hasExtra(Intent.EXTRA_TEXT)) {
                String extraText = intent.getStringExtra(Intent.EXTRA_TEXT);
                sharedContentSet.put(Tasks.DESCRIPTION, extraText);
                // check if supplied text is a URL
                if (extraText.startsWith("http://") && !extraText.contains(" ")) {
                    sharedContentSet.put(Tasks.URL, extraText);
                }

            }
            // hand over shared information to EditTaskFragment
            arguments.putParcelable(EditTaskFragment.PARAM_CONTENT_SET, sharedContentSet);

        } else if (ACTION_NOTE_TO_SELF.equals(action)) {
            // process the note to self intent
            ContentSet sharedContentSet = new ContentSet(Tasks.getContentUri(mAuthority));

            if (intent.hasExtra(Intent.EXTRA_SUBJECT)) {
                sharedContentSet.put(Tasks.DESCRIPTION, intent.getStringExtra(Intent.EXTRA_SUBJECT));
            }

            if (intent.hasExtra(Intent.EXTRA_TEXT)) {
                String extraText = intent.getStringExtra(Intent.EXTRA_TEXT);
                sharedContentSet.put(Tasks.TITLE, extraText);

            }

            // add start time stamp
            sharedContentSet.put(Tasks.DTSTART, System.currentTimeMillis());
            sharedContentSet.put(Tasks.TZ, TimeZone.getDefault().getID());

            // hand over shared information to EditTaskFragment
            arguments.putParcelable(EditTaskFragment.PARAM_CONTENT_SET, sharedContentSet);

        } else {
            // hand over task URI for editing / creating empty task
            arguments.putParcelable(EditTaskFragment.PARAM_TASK_URI, getIntent().getData());
            ContentSet data = getIntent().getParcelableExtra(EXTRA_DATA_CONTENT_SET);
            if (data != null) {
                arguments.putParcelable(EditTaskFragment.PARAM_CONTENT_SET, data);
            }
            String accountType = getIntent().getStringExtra(EXTRA_DATA_ACCOUNT_TYPE);
            if (accountType != null) {
                arguments.putString(EditTaskFragment.PARAM_ACCOUNT_TYPE, accountType);
            }
        }

        EditTaskFragment fragment = new EditTaskFragment();
        fragment.setArguments(arguments);
        getSupportFragmentManager().beginTransaction().add(R.id.add_task_container, fragment).commit();

    }

}

From source file:com.sonetel.plugins.sonetelcallthru.CallThru.java

@Override
public void onReceive(final Context context, Intent intent) {
    if (SipManager.ACTION_GET_PHONE_HANDLERS.equals(intent.getAction())) {
        // Retrieve and cache infos from the phone app 
        if (!sPhoneAppInfoLoaded) {
            Resources r = context.getResources();
            BitmapDrawable drawable = (BitmapDrawable) r.getDrawable(R.drawable.ic_wizard_sonetel);
            sPhoneAppBmp = drawable.getBitmap();

            sPhoneAppInfoLoaded = true;/*w  w  w .  j a  v  a2 s . c  om*/
        }

        Bundle results = getResultExtras(true);
        //if(pendingIntent != null) {
        //   results.putParcelable(CallHandlerPlugin.EXTRA_REMOTE_INTENT_TOKEN, pendingIntent);
        //}
        results.putString(Intent.EXTRA_TITLE, "Call thru");// context.getResources().getString(R.string.use_pstn));
        if (sPhoneAppBmp != null) {
            results.putParcelable(Intent.EXTRA_SHORTCUT_ICON, sPhoneAppBmp);
        }
        if (intent.getStringExtra(Intent.EXTRA_TEXT) == null)
            return;

        //final PendingIntent pendingIntent = null;
        final String callthrunum = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
        final String dialledNum = intent.getStringExtra(Intent.EXTRA_TEXT);
        // We must handle that clean way cause when call just to 
        // get the row in account list expect this to reply correctly
        if (callthrunum != null && PhoneCapabilityTester.isPhone(context)) {

            if (!callthrunum.equalsIgnoreCase("")) {
                DBAdapter dbAdapt = new DBAdapter(context);

                // Build pending intent

                SipAccount = dbAdapt.getAccount(1);

                if (SipAccount != null) {

                    Intent i = new Intent(Intent.ACTION_CALL);
                    i.setData(Uri.fromParts("tel", callthrunum, null));
                    final PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, i,
                            PendingIntent.FLAG_CANCEL_CURRENT);

                    NetWorkThread = new Thread() {
                        public void run() {
                            SendMsgToNetWork(dialledNum, context, pendingIntent);
                        };
                    };

                    NetWorkThread.start();

                }

                if (!dialledNum.equalsIgnoreCase("")) {
                    SipCallSessionImpl callInfo = new SipCallSessionImpl();

                    callInfo.setRemoteContact(dialledNum);
                    callInfo.setIncoming(false);
                    callInfo.callStart = System.currentTimeMillis();
                    callInfo.setAccId(3);
                    //callInfo.setLastStatusCode(pjsua.PJ_SUCCESS);

                    ContentValues cv = CallLogHelper.logValuesForCall(context, callInfo, callInfo.callStart);
                    context.getContentResolver().insert(SipManager.CALLLOG_URI, cv);

                }
            } else {
                Location_Finder LocFinder = new Location_Finder(context);
                if (LocFinder.getContryName().startsWith("your"))
                    Toast.makeText(context,
                            "Country of your current location unknown. Call thru not available.",
                            Toast.LENGTH_LONG).show();
                else
                    Toast.makeText(context,
                            "No Call thru access number available in " + LocFinder.getContryName(),
                            Toast.LENGTH_LONG).show();
                //Toast.makeText(context, "No Call thru access number available in ", Toast.LENGTH_LONG).show();
            }
        }

        // This will exclude next time tel:xxx is raised from csipsimple treatment which is wanted
        results.putString(Intent.EXTRA_PHONE_NUMBER, callthrunum);

    }

}