本文整理汇总了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());
}
}
示例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);
}
}
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}