當前位置: 首頁>>代碼示例>>Java>>正文


Java Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY屬性代碼示例

本文整理匯總了Java中android.content.Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY屬性的典型用法代碼示例。如果您正苦於以下問題:Java Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY屬性的具體用法?Java Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY怎麽用?Java Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.content.Intent的用法示例。


在下文中一共展示了Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleAppDeepLink

/**
 * Method to handle deeplink parameters received via intent
 */
private void handleAppDeepLink() {
    appDeepLink = new AppDeepLink(DeepLinkUtil.DEFAULT);

    // Extract deeplink params from the received intent
    Intent intent = getIntent();
    if (intent != null && !HTTextUtils.isEmpty(intent.getDataString())) {
        Log.d(TAG, "deeplink " + intent.getDataString());
        int flags = intent.getFlags();
        if ((flags & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0) {
            return;
        }
        appDeepLink = DeepLinkUtil.prepareAppDeepLink(this, intent.getData());
    }
}
 
開發者ID:hypertrack,項目名稱:hypertrack-live-android,代碼行數:17,代碼來源:SplashScreen.java

示例2: resolveIntent

private void resolveIntent(Intent data) {
    this.setIntent(data);

    if ((data.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0) {
        return;
    }

    if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(data.getAction())) {
        mLastNfcTag = data.getParcelableExtra(NfcAdapter.EXTRA_TAG);
        long now = new Date().getTime();

        if (mContinuousSensorReadingFlag) {
            startContinuousSensorReadingTimer();

        } else if (now - mLastScanTime > 5000) {
            DataPlotFragment dataPlotFragment = (DataPlotFragment)
                    mSectionsPagerAdapter.getRegisteredFragment(R.integer.viewpager_page_show_scan);
            if (dataPlotFragment != null) {
                dataPlotFragment.clearScanData();
            }

            new NfcVReaderTask(this).execute(mLastNfcTag);
        }
    }
}
 
開發者ID:DorianScholz,項目名稱:OpenLibre,代碼行數:25,代碼來源:MainActivity.java

示例3: handleIntent

/**
 * Handle this incoming intent (via onCreate()) and create a new session if required.
 */
public void handleIntent(final Context context, final SafeIntent intent, final Bundle savedInstanceState) {
    if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0) {
        // This Intent was launched from history (recent apps). Android will redeliver the
        // original Intent (which might be a VIEW intent). However if there's no active browsing
        // session then we do not want to re-process the Intent and potentially re-open a website
        // from a session that the user already "erased".
        return;
    }

    if (savedInstanceState != null) {
        // We are restoring a previous session - No need to handle this Intent.
        return;
    }

    createSessionFromIntent(context, intent);
}
 
開發者ID:mozilla-mobile,項目名稱:firefox-tv,代碼行數:19,代碼來源:SessionManager.java

示例4: onResume

@Override
public void onResume() {
	super.onResume();

	// Must disconnectAll before setting closeOnDisconnectAll to know whether to keep the
	// activity open after disconnecting.
	if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0 &&
			DISCONNECT_ACTION.equals(getIntent().getAction())) {
		Log.d(TAG, "Got disconnect all request");
		disconnectAll();
	}

	// Still close on disconnect if waiting for a disconnect.
	closeOnDisconnectAll = waitingForDisconnectAll && closeOnDisconnectAll;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:15,代碼來源:HostListActivity.java

示例5: preInflationStartup

@Override
public void preInflationStartup() {
    super.preInflationStartup();

    // Decide whether to record startup UMA histograms. This is done  early in the main
    // Activity.onCreate() to avoid recording navigation delays when they require user input to
    // proceed. For example, FRE (First Run Experience) happens before the activity is created,
    // and triggers initialization of the native library. At the moment it seems safe to assume
    // that uninitialized native library is an indication of an application start that is
    // followed by navigation immediately without user input.
    if (!LibraryLoader.isInitialized()) {
        UmaUtils.setRunningApplicationStart(true);
    }

    CommandLine commandLine = CommandLine.getInstance();
    if (commandLine.hasSwitch(ContentSwitches.ENABLE_TEST_INTENTS)
            && getIntent() != null
            && getIntent().hasExtra(
                    ChromeTabbedActivity.INTENT_EXTRA_TEST_RENDER_PROCESS_LIMIT)) {
        int value = getIntent().getIntExtra(
                ChromeTabbedActivity.INTENT_EXTRA_TEST_RENDER_PROCESS_LIMIT, -1);
        if (value != -1) {
            String[] args = new String[1];
            args[0] = "--" + ContentSwitches.RENDER_PROCESS_LIMIT
                    + "=" + Integer.toString(value);
            commandLine.appendSwitchesAndArguments(args);
        }
    }

    supportRequestWindowFeature(Window.FEATURE_ACTION_MODE_OVERLAY);

    // We are starting from history with a URL after data has been cleared. On Samsung this
    // can happen after user clears data and clicks on a recents item on pre-L devices.
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP
            && getIntent().getData() != null
            && (getIntent().getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0
            && OmahaClient.isFreshInstallOrDataHasBeenCleared(getApplicationContext())) {
        getIntent().setData(null);
    }
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:40,代碼來源:ChromeTabbedActivity.java

示例6: recycledIntent

private boolean recycledIntent() { // TODO this is a kludge, find real solution

        int flags = getIntent().getFlags();
        if ((flags & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) {
            Log.i(TAG, "Launched from history, killing recycled intent");
            setIntent(new Intent());
            return true;
        }
        return false;
    }
 
開發者ID:theGreatWhiteShark,項目名稱:mensacard-hack,代碼行數:10,代碼來源:NfcPlugin.java


注:本文中的android.content.Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。