當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。