Code example for Intent

Methods: setComponentsetFlags

0
        return ContentUris.withAppendedId(Calls.CONTENT_URI, cursor.getLong(0));
    } 
 
    /** Creates an intent that is bound to a specific activity by name. */ 
    private Intent bindIntentToClass(Intent intent, String activityClassName) {
        intent.setComponent(new ComponentName(ANDROID_CONTACTS_PACKAGE, activityClassName));
        return intent;
    } 
 
    private Intent buildFilterIntent(int actionCode, boolean legacy) {
        Intent intent = new Intent(UI.FILTER_CONTACTS_ACTION);
        intent.putExtra(UI.FILTER_TEXT_EXTRA_KEY, "A");
//        ContactsRequest request = new ContactsRequest(); 
//        request.setActionCode(actionCode); 
//        intent.putExtra("originalRequest", request); 
        return intent;
    } 
 
    private void startContactListActivity(Intent intent) {
        bindIntentToClass(intent, CONTACT_LIST_ACTIVITY_CLASS_NAME);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
    } 
 
    private void startContactSelectionActivityForResult(Intent intent) {
        startActivityForResult(intent, 12);