Java Code Examples for android.content.Intent.getCharSequenceExtra()

The following are Jave code examples for showing how to use getCharSequenceExtra() of the android.content.Intent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: FCM-for-Mojo   File: FFMIntentService.java   View Source Code Vote up 7 votes
@Override
protected void onHandleIntent(Intent intent) {
    if (intent == null) {
        return;
    }
    final String action = intent.getAction();
    if (ACTION_UPDATE_ICON.equals(action)) {
        ResultReceiver receiver = intent.getParcelableExtra(Intent.EXTRA_RESULT_RECEIVER);
        handleUpdateIcon(receiver);
    } else if (ACTION_REPLY.equals(action)) {
        CharSequence content = intent.getCharSequenceExtra(EXTRA_CONTENT);
        Chat chat = intent.getParcelableExtra(EXTRA_CHAT);
        handleReply(content, chat);
    } else if (ACTION_DOWNLOAD_QRCODE.equals(action)) {
        handleDownloadQrCode();
    } else if (ACTION_RESTART_WEBQQ.equals(action)) {
        handleRestart();
    }
}
 
Example 2
Project: MTweaks-KernelAdiutorMOD   File: CreateFragment.java   View Source Code Vote up 6 votes
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == 0 && data != null) {
        CharSequence text = data.getCharSequenceExtra(EditorActivity.TEXT_INTENT);
        if (text != null) {
            mCodeViews.get(mSettings.get(requestCode)).resetTest();
            mCodeViews.get(mSettings.get(requestCode)).setCode(text.toString().trim());
            showFab();
        }
    }
}
 
Example 3
Project: KernelAdiutor-Mod   File: CreateFragment.java   View Source Code Vote up 6 votes
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == 0 && data != null) {
        CharSequence text = data.getCharSequenceExtra(EditorActivity.TEXT_INTENT);
        if (text != null) {
            mCodeViews.get(mSettings.get(requestCode)).resetTest();
            mCodeViews.get(mSettings.get(requestCode)).setCode(text.toString().trim());
            showFab();
        }
    }
}
 
Example 4
Project: VirtualHook   File: ChooserActivity.java   View Source Code Vote up 6 votes
@SuppressLint("MissingSuperCall")
@Override
protected void onCreate(Bundle savedInstanceState) {
    Intent intent = getIntent();
    int userId = intent.getIntExtra(Constants.EXTRA_USER_HANDLE, VUserHandle.getCallingUserId());
    mOptions = intent.getParcelableExtra(EXTRA_DATA);
    mResultWho = intent.getStringExtra(EXTRA_WHO);
    mRequestCode = intent.getIntExtra(EXTRA_REQUEST_CODE, 0);
    Parcelable targetParcelable = intent.getParcelableExtra(Intent.EXTRA_INTENT);
    if (!(targetParcelable instanceof Intent)) {
        VLog.w("ChooseActivity", "Target is not an intent: " + targetParcelable);
        finish();
        return;
    }
    Intent target = (Intent) targetParcelable;
    CharSequence title = intent.getCharSequenceExtra(Intent.EXTRA_TITLE);
    if (title == null) {
        title = getString(R.string.choose);
    }
    Parcelable[] pa = intent.getParcelableArrayExtra(Intent.EXTRA_INITIAL_INTENTS);
    Intent[] initialIntents = null;
    if (pa != null) {
        initialIntents = new Intent[pa.length];
        for (int i = 0; i < pa.length; i++) {
            if (!(pa[i] instanceof Intent)) {
                VLog.w("ChooseActivity", "Initial intent #" + i
                        + " not an Intent: " + pa[i]);
                finish();
                return;
            }
            initialIntents[i] = (Intent) pa[i];
        }
    }
    super.onCreate(savedInstanceState, target, title, initialIntents, null, false, userId);
}
 
Example 5
Project: TPlayer   File: ChooserActivity.java   View Source Code Vote up 6 votes
@SuppressLint("MissingSuperCall")
@Override
protected void onCreate(Bundle savedInstanceState) {
    Intent intent = getIntent();
    int userId = intent.getIntExtra(Constants.EXTRA_USER_HANDLE, VUserHandle.getCallingUserId());
    mOptions = intent.getParcelableExtra(EXTRA_DATA);
    mResultWho = intent.getStringExtra(EXTRA_WHO);
    mRequestCode = intent.getIntExtra(EXTRA_REQUEST_CODE, 0);
    Parcelable targetParcelable = intent.getParcelableExtra(Intent.EXTRA_INTENT);
    if (!(targetParcelable instanceof Intent)) {
        VLog.w("ChooseActivity", "Target is not an intent: " + targetParcelable);
        finish();
        return;
    }
    Intent target = (Intent) targetParcelable;
    CharSequence title = intent.getCharSequenceExtra(Intent.EXTRA_TITLE);
    if (title == null) {
        title = getString(R.string.choose);
    }
    Parcelable[] pa = intent.getParcelableArrayExtra(Intent.EXTRA_INITIAL_INTENTS);
    Intent[] initialIntents = null;
    if (pa != null) {
        initialIntents = new Intent[pa.length];
        for (int i = 0; i < pa.length; i++) {
            if (!(pa[i] instanceof Intent)) {
                VLog.w("ChooseActivity", "Initial intent #" + i
                        + " not an Intent: " + pa[i]);
                finish();
                return;
            }
            initialIntents[i] = (Intent) pa[i];
        }
    }
    super.onCreate(savedInstanceState, target, title, initialIntents, null, false, userId);
}
 
Example 6
Project: container   File: ChooserActivity.java   View Source Code Vote up 6 votes
@Override
protected void onCreate(Bundle savedInstanceState) {
    Intent intent = getIntent();
    int userId = intent.getIntExtra(Constants.EXTRA_USER_HANDLE, VUserHandle.getCallingUserId());
    mOptions = intent.getParcelableExtra(EXTRA_DATA);
    mResultWho = intent.getStringExtra(EXTRA_WHO);
    mRequestCode = intent.getIntExtra(EXTRA_REQUEST_CODE, 0);
    Parcelable targetParcelable = intent.getParcelableExtra(Intent.EXTRA_INTENT);
    if (!(targetParcelable instanceof Intent)) {
        VLog.w("ChooseActivity", "Target is not an intent: " + targetParcelable);
        finish();
        return;
    }
    Intent target = (Intent) targetParcelable;
    CharSequence title = intent.getCharSequenceExtra(Intent.EXTRA_TITLE);
    if (title == null) {
        title = getString(R.string.choose);
    }
    Parcelable[] pa = intent.getParcelableArrayExtra(Intent.EXTRA_INITIAL_INTENTS);
    Intent[] initialIntents = null;
    if (pa != null) {
        initialIntents = new Intent[pa.length];
        for (int i = 0; i < pa.length; i++) {
            if (!(pa[i] instanceof Intent)) {
                VLog.w("ChooseActivity", "Initial intent #" + i
                        + " not an Intent: " + pa[i]);
                finish();
                return;
            }
            initialIntents[i] = (Intent) pa[i];
        }
    }
    super.onCreate(savedInstanceState, target, title, initialIntents, null, false, userId);
}