当前位置: 首页>>代码示例>>Java>>正文


Java Intent.getFlags方法代码示例

本文整理汇总了Java中android.content.Intent.getFlags方法的典型用法代码示例。如果您正苦于以下问题:Java Intent.getFlags方法的具体用法?Java Intent.getFlags怎么用?Java Intent.getFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.content.Intent的用法示例。


在下文中一共展示了Intent.getFlags方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resolveIntent

import android.content.Intent; //导入方法依赖的package包/类
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,代码行数:26,代码来源:MainActivity.java

示例2: queryIntentFromList

import android.content.Intent; //导入方法依赖的package包/类
public List<R> queryIntentFromList(Intent intent, String resolvedType, 
        boolean defaultOnly, ArrayList<F[]> listCut) {
    ArrayList<R> resultList = new ArrayList<R>();

    final boolean debug = localLOGV ||
            ((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0);

    FastImmutableArraySet<String> categories = getFastIntentCategories(intent);
    final String scheme = intent.getScheme();
    int N = listCut.size();
    for (int i = 0; i < N; ++i) {
        buildResolveList(intent, categories, debug, defaultOnly,
                resolvedType, scheme, listCut.get(i), resultList);
    }
    sortResults(resultList);
    return resultList;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:18,代码来源:IntentResolver.java

示例3: handleAppDeepLink

import android.content.Intent; //导入方法依赖的package包/类
/**
 * 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,代码行数:18,代码来源:SplashScreen.java

示例4: resolveService

import android.content.Intent; //导入方法依赖的package包/类
@Override public ResolveInfo resolveService(final Intent intent, final int flags) {
	final int original_intent_flags = intent.getFlags();
	// Intent flags could only filter background receivers, we have to deal with services by ourselves.
	return mCondom.proceed(OutboundType.QUERY_SERVICES, intent, null, new CondomCore.WrappedValueProcedure<ResolveInfo>() { @Override public ResolveInfo proceed() {
		if (! mCondom.mExcludeBackgroundServices && mCondom.mOutboundJudge == null)
			return CondomPackageManager.super.resolveService(intent, flags);	// Shortcut for pass-through

		final List<ResolveInfo> candidates = CondomPackageManager.super.queryIntentServices(intent, flags);
		final Intent original_intent = intent.setFlags(original_intent_flags);	// Restore the intent flags early before getFirstMatch().
		return mCondom.filterCandidates(OutboundType.QUERY_SERVICES, original_intent, candidates, TAG, false);
	}});
}
 
开发者ID:Trumeet,项目名称:MiPushFramework,代码行数:13,代码来源:CondomContext.java

示例5: queryIntentFromList

import android.content.Intent; //导入方法依赖的package包/类
public List<R> queryIntentFromList(Intent intent, String resolvedType, boolean defaultOnly,
		ArrayList<F[]> listCut) {
	ArrayList<R> resultList = new ArrayList<R>();

	final boolean debug = localLOGV || ((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0);

	FastImmutableArraySet<String> categories = getFastIntentCategories(intent);
	final String scheme = intent.getScheme();
	int N = listCut.size();
	for (int i = 0; i < N; ++i) {
		buildResolveList(intent, categories, debug, defaultOnly, resolvedType, scheme, listCut.get(i), resultList);
	}
	sortResults(resultList);
	return resultList;
}
 
开发者ID:codehz,项目名称:container,代码行数:16,代码来源:IntentResolver.java

示例6: onNewIntent

import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);


    if (System.currentTimeMillis() - mPauseTime < 1000  && Intent.ACTION_MAIN.equals(intent.getAction())) {

        final boolean alreadyOnHome =
                ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT)
                        != Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
        Log.d("LaunchTime", " new intent " + alreadyOnHome);
        if (alreadyOnHome && !mChildLock) {

            // If we are on home screen, reset most things and go to top category.
            mCategoriesScroller.postDelayed(new Runnable() {
                @Override
                public void run() {
                    try {
                        mSearchBox.setSearchText("");
                        mCategoriesScroller.smoothScrollTo(0, 0);
                        showButtonBar(false, true);
                        mIconSheetScroller.smoothScrollTo(0, 0);
                        switchCategory(getTopCategory());
                        mQuickRow.scrollToStart();
                        mIconSheetScroller.smoothScrollTo(0, 0);
                        mCategoriesScroller.smoothScrollTo(0, 0);
                    } catch (Exception e) {
                        Log.e(TAG, e.getMessage(), e);
                    }

                }
            }, 200);
        }

    }
}
 
开发者ID:quaap,项目名称:LaunchTime,代码行数:37,代码来源:MainActivity.java

示例7: ensureUriPermission

import android.content.Intent; //导入方法依赖的package包/类
@SuppressWarnings("ResourceType")
@TargetApi(Build.VERSION_CODES.KITKAT)
public static Uri ensureUriPermission(Context context, Intent intent) {
    Uri uri = intent.getData();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        final int takeFlags = intent.getFlags() & Intent.FLAG_GRANT_READ_URI_PERMISSION;
        context.getContentResolver().takePersistableUriPermission(uri, takeFlags);
    }
    return uri;
}
 
开发者ID:chenliguan,项目名称:Android-BitherCompress-master,代码行数:11,代码来源:MainActivity.java

示例8: createCustomTabActivityIntent

import android.content.Intent; //导入方法依赖的package包/类
/**
 * Creates an Intent that can be used to launch a {@link CustomTabActivity}.
 */
public static Intent createCustomTabActivityIntent(
        Context context, Intent intent, boolean addHerbExtras) {
    // Use the copy constructor to carry over the myriad of extras.
    Uri uri = Uri.parse(IntentHandler.getUrlFromIntent(intent));

    Intent newIntent = new Intent(intent);
    newIntent.setAction(Intent.ACTION_VIEW);
    newIntent.setClassName(context, CustomTabActivity.class.getName());
    newIntent.setData(uri);

    // If a CCT intent triggers First Run, then NEW_TASK will be automatically applied.  As
    // part of that, it will inherit the EXCLUDE_FROM_RECENTS bit from ChromeLauncherActivity,
    // so explicitly remove it to ensure the CCT does not get lost in recents.
    if ((newIntent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) != 0
            || (newIntent.getFlags() & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) != 0) {
        newIntent.setFlags(
                newIntent.getFlags() & ~Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
    }

    if (addHerbExtras) {
        // TODO(tedchoc|mariakhomenko): Specifically not marking the intent is from Chrome via
        //                              IntentHandler.addTrustedIntentExtras as it breaks the
        //                              redirect logic for triggering instant apps.  See if
        //                              this is better addressed in TabRedirectHandler long
        //                              term.
        newIntent.putExtra(CustomTabIntentDataProvider.EXTRA_IS_OPENED_BY_CHROME, true);
    } else {
        IntentUtils.safeRemoveExtra(
                intent, CustomTabIntentDataProvider.EXTRA_IS_OPENED_BY_CHROME);
    }
    if (addHerbExtras) updateHerbIntent(context, newIntent);

    return newIntent;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:38,代码来源:ChromeLauncherActivity.java

示例9: extract

import android.content.Intent; //导入方法依赖的package包/类
static HashSet<String> extract(@NonNull Intent intent) {
    final int flags = intent.getFlags();
    HashSet<String> flagsStrings = new HashSet<>();
    for (int i = 0; i < FLAGS.size(); i++) {
        int key = FLAGS.keyAt(i);
        String value = FLAGS.valueAt(i);
        if ((flags & key) != 0) {
            flagsStrings.add(value);
        }
    }
    return flagsStrings;
}
 
开发者ID:SimonMarquis,项目名称:Android-App-Linking,代码行数:13,代码来源:Flags.java

示例10: onNewIntent

import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    if ((Intent.FLAG_ACTIVITY_CLEAR_TOP & intent.getFlags()) != 0 ){
        finish();
    }
}
 
开发者ID:jiangkang,项目名称:KTools,代码行数:8,代码来源:MainActivity.java

示例11: onReceive

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    if (mApp.isBooting()) {
        return;
    }
    if ((intent.getFlags() & FLAG_RECEIVER_REGISTERED_ONLY) != 0 || isInitialStickyBroadcast()) {
        return;
    }
    PendingResult result = goAsync();
    synchronized (mAMS) {
        if (!mAMS.handleStaticBroadcast(appId, info, intent, new PendingResultData(result))) {
            result.finish();
        }
    }
}
 
开发者ID:codehz,项目名称:container,代码行数:16,代码来源:BroadcastSystem.java

示例12: queryIntentServices

import android.content.Intent; //导入方法依赖的package包/类
@Override public List<ResolveInfo> queryIntentServices(final Intent intent, final int flags) {
	final int original_intent_flags = intent.getFlags();
	return mCondom.proceedQuery(OutboundType.QUERY_SERVICES, intent, new CondomCore.WrappedValueProcedure<List<ResolveInfo>>() {
		@Override public List<ResolveInfo> proceed() {
			final List<ResolveInfo> result = CondomPackageManager.super.queryIntentServices(intent, flags);
			mCondom.filterCandidates(OutboundType.QUERY_SERVICES, intent.setFlags(original_intent_flags), result, TAG, true);
			return result;
		}
	}, CondomCore.SERVICE_PACKAGE_GETTER);
}
 
开发者ID:oasisfeng,项目名称:condom,代码行数:11,代码来源:CondomPackageManager.java

示例13: resolveService

import android.content.Intent; //导入方法依赖的package包/类
@Override public ResolveInfo resolveService(final Intent intent, final int flags) {
	final int original_intent_flags = intent.getFlags();
	// Intent flags could only filter background receivers, we have to deal with services by ourselves.
	return mCondom.proceed(OutboundType.QUERY_SERVICES, intent, null, new CondomCore.WrappedValueProcedure<ResolveInfo>() {
		@Override public ResolveInfo proceed() {
			if (! mCondom.mExcludeBackgroundServices && mCondom.mOutboundJudge == null)
				return CondomPackageManager.super.resolveService(intent, flags);    // Shortcut for pass-through

			final List<ResolveInfo> candidates = CondomPackageManager.super.queryIntentServices(intent, flags);
			final Intent original_intent = intent.setFlags(original_intent_flags);    // Restore the intent flags early before getFirstMatch().
			return mCondom.filterCandidates(OutboundType.QUERY_SERVICES, original_intent, candidates, TAG, false);
		}
	});
}
 
开发者ID:oasisfeng,项目名称:condom,代码行数:15,代码来源:CondomPackageManager.java

示例14: onReceive

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    if (mApp.isBooting()) {
        return;
    }
    if ((intent.getFlags() & FLAG_RECEIVER_REGISTERED_ONLY) != 0 || isInitialStickyBroadcast()) {
        return;
    }
    PendingResult result = goAsync();
    if (!mAMS.handleStaticBroadcast(appId, info, intent, new PendingResultData(result))) {
        result.finish();
    }
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:14,代码来源:BroadcastSystem.java

示例15: queryIntentServices

import android.content.Intent; //导入方法依赖的package包/类
@Override public List<ResolveInfo> queryIntentServices(final Intent intent, final int flags) {
	final int original_intent_flags = intent.getFlags();
	return mCondom.proceedQuery(OutboundType.QUERY_SERVICES, intent, new CondomCore.WrappedValueProcedure<List<ResolveInfo>>() { @Override public List<ResolveInfo> proceed() {
		final List<ResolveInfo> result = CondomPackageManager.super.queryIntentServices(intent, flags);
		mCondom.filterCandidates(OutboundType.QUERY_SERVICES, intent.setFlags(original_intent_flags), result, TAG, true);
		return result;
	}});
}
 
开发者ID:Trumeet,项目名称:MiPushFramework,代码行数:9,代码来源:CondomContext.java


注:本文中的android.content.Intent.getFlags方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。