Intent getFlags - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Intent getFlags method.

This code example shows how to use the following methods:startActivitySync, getFlags, setFlags
        instrumentation.sendStringSync("s");
        poseForScreenshotNamed("ConfigureMorseActivity-SOS"); 
    } 
 
    private <T extends Activity> T startActivitySync(Class<T> clazz) {
        Intent intent = new Intent(getInstrumentation().getTargetContext(), clazz);
        intent.setFlags(intent.getFlags() | FLAG_ACTIVITY_NEW_TASK);
        return (T) getInstrumentation().startActivitySync(intent);
    } 
 
} 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getData, getFlags
     * 
     * @param intent The intent received in {@link #onNewIntent(Intent)} 
     */ 
    private void setupDialUri(Intent intent) {
        // If the intent was relaunched from history, don't reapply the intent. 
        if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0) {
            return; 
        } 
        mDialUri = intent.getData();
    } 
 
    @Override 
    public void onBackPressed() { 
        if (isTaskRoot()) {
            // Instead of stopping, simply push this to the back of the stack. 
            // This is only done when running at the top of the stack; 
            // otherwise, we have been launched by someone else so need to 
            // allow the user to go back to the caller. 
            moveTaskToBack(false);
        } else { 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getFlags
     * @param cn The ComponentName 
     * @param request The requested intent 
     * @return Intent The intent 
     */ 
    public static final Intent getIntentFromComponentName(ComponentName cn, Intent request) {
        Intent intent = new Intent(request);
        intent.setFlags(
                intent.getFlags() &~
                Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
        intent.addFlags(
                Intent.FLAG_ACTIVITY_FORWARD_RESULT |
                Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
        intent.setComponent(
                new ComponentName(
                        cn.getPackageName(),
                        cn.getClassName()));
        return intent;
    } 
 
    /** 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Intent getFlags Questions & Answers:

getFlags Method Overview
Retrieve any special flags associated with this intent.
See Code Examples for other Android Intent Methods: