Example usage for android.content Intent FLAG_ACTIVITY_REORDER_TO_FRONT

List of usage examples for android.content Intent FLAG_ACTIVITY_REORDER_TO_FRONT

Introduction

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

Prototype

int FLAG_ACTIVITY_REORDER_TO_FRONT

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

Click Source Link

Document

If set in an Intent passed to Context#startActivity Context.startActivity() , this flag will cause the launched activity to be brought to the front of its task's history stack if it is already running.

Usage

From source file:eu.thecoder4.gpl.pleftdroid.EventDetailActivity.java

private void goMainActivity() {
    Intent ipd = new Intent(this, PleftDroidActivity.class);
    ipd.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
    startActivity(ipd);/*from   w ww.  ja v  a 2  s .  c o m*/
}

From source file:org.kegbot.app.HomeActivity.java

/**
 * Shows the tap editor for the given tap, prompting for the manager pin if necessary.
 *
 * @param context//from   w w  w.jav  a  2  s.c o  m
 * @param meterName
 */
static void showTapEditor(Context context, String meterName) {
    final Intent editorIntent = new Intent(context, HomeActivity.class);
    editorIntent.setAction(ACTION_SHOW_TAP_EDITOR);
    editorIntent.putExtra(EXTRA_METER_NAME, meterName);
    editorIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
    PinActivity.startThroughPinActivity(context, editorIntent);
}

From source file:com.bonsai.wallet32.PasscodeActivity.java

private void validateComplete(boolean isValid) {

    if (!isValid) {
        mLogger.info("passcode invalid");

        // Clear the passcode.
        setPasscode(""); // Clear the string.

        mState = State.PASSCODE_ENTER;

        // If we are paused we defer the dialog to when we
        // are resumed ...
        ////  ww w . j ava  2 s. c  om
        if (!mIsPaused) {
            showPasscodeInvalidDialog();
        } else {
            mLogger.info("deferring passcode invalid dialog");
            mPasscodeWasInvalid = true;
        }

        return;
    }

    // The passcode was valid.
    mApp.setPasscodeValidTimestamp();

    switch (mAction) {
    case ACTION_LOGIN:
        // Spin up the WalletService.
        Intent svcintent = new Intent(this, WalletService.class);
        Bundle bundle = new Bundle();
        bundle.putString("SyncState", "STARTUP");
        svcintent.putExtras(bundle);
        startService(svcintent);

        mApp.setLoggedIn();

        // Off to the main activity.
        Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);

        // And we're done with this activity.
        finish();
        break;

    case ACTION_CHANGE:
        // Now we're ready to create a new passcode.
        mState = State.PASSCODE_CREATE;
        TextView msgtv = (TextView) findViewById(R.id.message);
        msgtv.setText(R.string.passcode_create);
        setPasscode("");
        show_esthack(true);
        return;

    case ACTION_VIEWSEED:
        // Off to view the seed.
        Intent intent2 = new Intent(this, ViewSeedActivity.class);
        intent2.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        startActivity(intent2);

        // And we're done with this activity.
        finish();
        break;

    case ACTION_SHOWPAIRING:
        // Off to view the pairing code.
        Intent intent3 = new Intent(this, ShowPairingActivity.class);
        intent3.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        startActivity(intent3);

        // And we're done with this activity.
        finish();
        break;
    }
}

From source file:cz.muni.fi.japanesedictionary.main.MainActivity.java

/**
 * Listener for menu item selected.//from   w w  w  .  j  a  va2 s.co m
 *
 * @param item - home item selected, restarts main activity
 *        - settings item selceted, launches new MypreferenceActivity
 *        - other item, default behavior
 */
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // The action bar home/up action should open or close the drawer.
    // ActionBarDrawerToggle will take care of this.
    mDrawerLayout.closeDrawer(mDrawerList);
    if (mDrawerToggle.onOptionsItemSelected(item)) {
        return true;
    }

    switch (item.getItemId()) {
    case android.R.id.home:
        // app icon in action bar clicked; go home
        Log.i(LOG_TAG, "Home button pressed");
        Intent intent = new Intent(this, MainActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(intent);
        return true;
    case R.id.settings:
        Log.i(LOG_TAG, "Lauching preference Activity");
        Intent intentSetting = new Intent(this.getApplicationContext(), MyPreferencesActivity.class);
        intentSetting.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        startActivity(intentSetting);
        return true;
    case R.id.about:
        Log.i(LOG_TAG, "Lauching About Activity");
        Intent intentAbout = new Intent(this.getApplicationContext(), AboutActivity.class);
        intentAbout.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        startActivity(intentAbout);
        return true;
    default:
        return super.onOptionsItemSelected(item);
    }
}

From source file:com.aware.Aware_Preferences.java

@Override
protected Dialog onCreateDialog(int id) {
    Dialog dialog = null;//w w w .  j  av  a  2s .  c  om
    AlertDialog.Builder builder = new AlertDialog.Builder(this);

    switch (id) {
    case DIALOG_ERROR_ACCESSIBILITY:
        builder.setMessage("Please activate AWARE on the Accessibility Services!");
        builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
                Intent accessibilitySettings = new Intent(
                        android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS);
                accessibilitySettings
                        .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
                startActivity(accessibilitySettings);
            }
        });
        dialog = builder.create();
        break;
    case DIALOG_ERROR_MISSING_PARAMETERS:
        builder.setMessage("Some parameters are missing...");
        builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });
        dialog = builder.create();
        break;
    case DIALOG_ERROR_MISSING_SENSOR:
        builder.setMessage("This device is missing this sensor.");
        builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });
        dialog = builder.create();
        break;
    }
    return dialog;
}

From source file:org.dkf.jmule.activities.MainActivity.java

private void openTorrentUrl(Intent intent) {
    try {/*from   www . j a  v a2s.  c  o m*/
        //Open a Torrent from a URL or from a local file :), say from Astro File Manager.

        //Show me the transfer tab
        Intent i = new Intent(this, MainActivity.class);
        i.setAction(ED2KService.ACTION_SHOW_TRANSFERS);
        i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        startActivity(i);

        //go!
        final String uri = intent.getDataString();
        intent.setAction(null);
        if (uri != null) {
            if (uri.startsWith("file") || uri.startsWith("http") || uri.startsWith("https")
                    || uri.startsWith("magnet")) {
                //TransferManager.instance().downloadTorrent(uri, new HandpickedTorrentDownloadDialogOnFetch(this));
            } else if (uri.startsWith("content")) {
                String newUri = saveViewContent(this, Uri.parse(uri), "content-intent.torrent");
                if (newUri != null) {
                    //TransferManager.instance().downloadTorrent(newUri, new HandpickedTorrentDownloadDialogOnFetch(this));
                }
            }
        } else {
            log.warn(
                    "MainActivity.onNewIntent(): Couldn't start torrent download from Intent's URI, intent.getDataString() -> null");
            log.warn("(maybe URI is coming in another property of the intent object - #fragmentation)");
        }
    } catch (Throwable e) {
        log.error("Error opening torrent from intent", e);
    }
}

From source file:org.benetech.secureapp.activities.FormGroupActivity.java

private void goBackToMainFormEntryActivity() {
    Intent entryIntent = new Intent(this, MainFormEntryActivity.class);
    entryIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
    startActivity(entryIntent);/*from  ww w .j av  a 2 s. c om*/
}

From source file:de.spiritcroc.modular_remote.MainActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.action_settings:
        startActivity(new Intent(this, SettingsActivity.class).addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT));
        return true;
    case R.id.action_about:
        new AboutDialog().show(getFragmentManager(), "AboutDialog");
        return true;
    case R.id.action_edit_page_content:
        enterEditMode();//from  w w w .j  av  a  2  s .  c o m
        return true;
    case R.id.action_connection_manager:
        new SelectConnectionDialog().show(getFragmentManager(), "SelectConnectionDialog");
        return true;
    default:
        return super.onOptionsItemSelected(item);
    }
}

From source file:com.zira.registration.DocumentUploadActivity.java

@Override
public void onBackPressed() {
    Intent intent = new Intent(DocumentUploadActivity.this, BackgroundCheckActivity.class);
    intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
    startActivity(intent);/*from  ww w  .j av  a 2  s. c o  m*/
}

From source file:info.curtbinder.reefangel.service.NotificationService.java

private Intent getStatusActivity() {
    Intent si = new Intent(this, StatusActivity.class);
    si.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    si.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    si.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
    return si;//from   w w w  .  j  a v  a2 s.co  m
}