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


Java IntentFilter.addDataScheme方法代码示例

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


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

示例1: registerApkInstallReceiver

import android.content.IntentFilter; //导入方法依赖的package包/类
public synchronized static void registerApkInstallReceiver(Context context) {
	
	try {
		if (context == null) {
			return;
		}
		Context applicationContext = context.getApplicationContext();
		if (applicationContext == null) {
			return;
		}
		if (mReceiver != null) {
			return;
		}
		ApkInstallBroadcastReceiver receiver = new ApkInstallBroadcastReceiver();
		IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
		filter.addDataScheme("package");
		applicationContext.registerReceiver(receiver, filter);
		mReceiver = receiver;
	} catch (Throwable e) {
		DLog.e(e);
	}
}
 
开发者ID:youmi,项目名称:nativead,代码行数:23,代码来源:AdInstallUtils.java

示例2: setListening

import android.content.IntentFilter; //导入方法依赖的package包/类
public void setListening(boolean listening) {
    if (mListening == listening) return;
    mListening = listening;
    if (mListening) {
        // listen for package changes
        IntentFilter filter = new IntentFilter();
        filter.addAction(Intent.ACTION_PACKAGE_ADDED);
        filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
        filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
        filter.addAction(Intent.ACTION_PACKAGE_REPLACED);
        filter.addDataScheme("package");
        mContext.registerReceiver(mPackageReceiver, filter);
        mContentResolver.registerContentObserver(Settings.Secure.getUriFor(mConfig.setting),
                false, mSettingsObserver);
    } else {
        mContext.unregisterReceiver(mPackageReceiver);
        mContentResolver.unregisterContentObserver(mSettingsObserver);
    }
}
 
开发者ID:ric96,项目名称:lineagex86,代码行数:20,代码来源:ServiceListing.java

示例3: onCreate

import android.content.IntentFilter; //导入方法依赖的package包/类
public void onCreate() {
  //  myLog.l(Log.DEBUG, "SwiFTP server created");
    // Set the application-wide context global, if not already set
    Context myContext = Globals.getContext();
    if (myContext == null) {
        myContext = getApplicationContext();
        if (myContext != null) {
            Globals.setContext(myContext);
        }
    }

    IntentFilter intentFilter = new IntentFilter();
    intentFilter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
    intentFilter.addDataScheme("file");
    registerReceiver(mReceiver, intentFilter);
    return;
}
 
开发者ID:stytooldex,项目名称:stynico,代码行数:18,代码来源:S_MVP.java

示例4: onCreate

import android.content.IntentFilter; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    Utils.debugLog(TAG, "creating Service");
    localBroadcastManager = LocalBroadcastManager.getInstance(this);
    appUpdateStatusManager = AppUpdateStatusManager.getInstance(this);

    BroadcastReceiver br = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            String packageName = intent.getData().getSchemeSpecificPart();
            for (AppUpdateStatusManager.AppUpdateStatus status : appUpdateStatusManager.getByPackageName(packageName)) {
                appUpdateStatusManager.updateApk(status.getUniqueKey(), AppUpdateStatusManager.Status.Installed, null);
            }
        }
    };
    IntentFilter intentFilter = new IntentFilter();
    intentFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
    intentFilter.addDataScheme("package");
    registerReceiver(br, intentFilter);
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:22,代码来源:InstallManagerService.java

示例5: setContext

import android.content.IntentFilter; //导入方法依赖的package包/类
private synchronized void setContext(SipService ctxt) {
    // If we have a new context, restart bindings
	if(service != ctxt) {
   	    // Reset
   		quit();
   		// Set new service
   		service = ctxt;
   		alarmManager = (AlarmManager) service.getSystemService(Context.ALARM_SERVICE);
           wakeLock = new SipWakeLock((PowerManager) ctxt.getSystemService(Context.POWER_SERVICE));
	}
	if(!serviceRegistered) {
   		IntentFilter filter = new IntentFilter(TIMER_ACTION);
   		filter.addDataScheme(EXTRA_TIMER_SCHEME);
   		service.registerReceiver(this, filter);
   		serviceRegistered = true;
	}
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:18,代码来源:TimerWrapper.java

示例6: onCreate

import android.content.IntentFilter; //导入方法依赖的package包/类
public void onCreate(Bundle bundle){
    super.onCreate(bundle);
    mUpdateReceiver = new BroadcastReceiver(){
        @Override
        public void onReceive(Context context, Intent intent) {
            if(intent!=null&& ArchosMediaIntent.ACTION_VIDEO_SCANNER_SCAN_FINISHED.equals(intent.getAction())) {
                getLoaderManager().restartLoader(LOADER_ID_LAST_ADDED, null, MainFragment.this);
                Log.d(TAG, "manual reload");
            }
        }
    };

    mUpdateFilter = new IntentFilter();
    for(String scheme : UriUtils.sIndexableSchemes){
        mUpdateFilter.addDataScheme(scheme);
    }
    mUpdateFilter.addAction(ArchosMediaIntent.ACTION_VIDEO_SCANNER_SCAN_FINISHED);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:19,代码来源:MainFragment.java

示例7: onViewCreated

import android.content.IntentFilter; //导入方法依赖的package包/类
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    selectedType = 0;
    this.exchid = "2";
    this.isFirst = true;
    this.currentPage = 1;
    this.currentPage2 = 1;
    this.currentPage3 = 1;
    findView();
    this.inBootReciever = new BootReciever(this);
    IntentFilter filter = new IntentFilter();
    filter.addAction("android.intent.action.PACKAGE_ADDED");
    filter.addAction("android.intent.action.PACKAGE_REMOVED");
    filter.addDataScheme("package");
    getActivity().registerReceiver(this.inBootReciever, filter);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:17,代码来源:TopRecommendFragment.java

示例8: AppLauncher

import android.content.IntentFilter; //导入方法依赖的package包/类
public AppLauncher(Context context, XSharedPreferences prefs) throws Throwable {
    mContext = context;
    mResources = mContext.getResources();
    mPrefs = prefs;
    mGbContext = Utils.getGbContext(mContext);
    mGbResources = mGbContext.getResources();
    mHandler = new Handler();
    mPm = mContext.getPackageManager();

    mAppSlots = new ArrayList<AppInfo>();
    mAppSlots.add(new AppInfo(R.id.quickapp1));
    mAppSlots.add(new AppInfo(R.id.quickapp2));
    mAppSlots.add(new AppInfo(R.id.quickapp3));
    mAppSlots.add(new AppInfo(R.id.quickapp4));
    mAppSlots.add(new AppInfo(R.id.quickapp5));
    mAppSlots.add(new AppInfo(R.id.quickapp6));
    mAppSlots.add(new AppInfo(R.id.quickapp7));
    mAppSlots.add(new AppInfo(R.id.quickapp8));
    mAppSlots.add(new AppInfo(R.id.quickapp9));
    mAppSlots.add(new AppInfo(R.id.quickapp10));
    mAppSlots.add(new AppInfo(R.id.quickapp11));
    mAppSlots.add(new AppInfo(R.id.quickapp12));

    IntentFilter intentFilter = new IntentFilter(Intent.ACTION_PACKAGE_FULLY_REMOVED);
    intentFilter.addDataScheme("package");
    mContext.registerReceiver(mPackageRemoveReceiver, intentFilter);
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:28,代码来源:AppLauncher.java

示例9: onAttach

import android.content.IntentFilter; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    IntentFilter intentFilter = new IntentFilter(ExtStorageReceiver.ACTION_MEDIA_MOUNTED);
    intentFilter.addAction(ExtStorageReceiver.ACTION_MEDIA_UNMOUNTED);
    intentFilter.addAction(ExtStorageReceiver.ACTION_MEDIA_CHANGED);
    intentFilter.addDataScheme("file");
    intentFilter.addDataScheme(ExtStorageReceiver.ARCHOS_FILE_SCHEME);//new android nougat send UriExposureException when scheme = file
    getActivity().registerReceiver(mExternalStorageReceiver, intentFilter);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:11,代码来源:MainFragment.java

示例10: onStart

import android.content.IntentFilter; //导入方法依赖的package包/类
@Override
public void onStart() {
    super.onStart();
    receiver = new Receiver();
    IntentFilter filter = new IntentFilter();
    filter.addAction("android.intent.action.PACKAGE_ADDED");
    filter.addAction("android.intent.action.PACKAGE_REMOVED");
    filter.addDataScheme("package");
    mContext.registerReceiver(receiver, filter);
}
 
开发者ID:Evan-Galvin,项目名称:FreeStreams-TVLauncher,代码行数:11,代码来源:AppFragment.java

示例11: onCreate

import android.content.IntentFilter; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    log.d("onCreate()");

    IntentFilter intentFilter = new IntentFilter(ACTION_STOP_RECORDING);
    intentFilter.addDataScheme(URI_SCHEME);

    registerReceiver(receiver, intentFilter);

    handler = new Handler(Looper.getMainLooper());
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:13,代码来源:LogcatRecordingService.java

示例12: getIntentFilter

import android.content.IntentFilter; //导入方法依赖的package包/类
/**
 * Get a prepared {@link IntentFilter} for use for matching this service's action events.
 *
 * @param urlString The full file URL to match.
 */
public static IntentFilter getIntentFilter(String urlString) {
    Uri uri = Uri.parse(urlString);
    IntentFilter intentFilter = new IntentFilter();
    intentFilter.addAction(Downloader.ACTION_STARTED);
    intentFilter.addAction(Downloader.ACTION_PROGRESS);
    intentFilter.addAction(Downloader.ACTION_COMPLETE);
    intentFilter.addAction(Downloader.ACTION_INTERRUPTED);
    intentFilter.addAction(Downloader.ACTION_CONNECTION_FAILED);
    intentFilter.addDataScheme(uri.getScheme());
    intentFilter.addDataAuthority(uri.getHost(), String.valueOf(uri.getPort()));
    intentFilter.addDataPath(uri.getPath(), PatternMatcher.PATTERN_LITERAL);
    return intentFilter;
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:19,代码来源:DownloaderService.java

示例13: bindReceiver

import android.content.IntentFilter; //导入方法依赖的package包/类
private void bindReceiver(final T view) {
  receiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {

      handleIntent(view, intent);
    }
  };

  manager = LocalBroadcastManager.getInstance(context);

  final IntentFilter filter = new IntentFilter();
  filter.addAction(Intent.ACTION_VIEW);
  filter.addCategory(Intent.CATEGORY_DEFAULT);

  final Uri[] uris = new Uri[kolibriUris().length];

  for (int i = 0; i < uris.length; ++i) {
    uris[i] = Uri.parse(kolibriUris()[i]);

    final Uri uri = uris[i];

    filter.addDataScheme(uri.getScheme());
    filter.addDataAuthority(uri.getHost(), null);
  }

  manager.registerReceiver(receiver, filter);
}
 
开发者ID:azmedien,项目名称:kolibri-android,代码行数:29,代码来源:KolibriCoordinator.java

示例14: registerPluginInstalledBroadcastReceiver

import android.content.IntentFilter; //导入方法依赖的package包/类
private void registerPluginInstalledBroadcastReceiver() {
    IntentFilter filter = new IntentFilter();
    filter.addAction(ApkManager.ACTION_PACKAGE_ADDED);
    filter.addDataScheme("package");
    LogInfo.log("plugin", "注册广播: com.letv.plugin.pluginloader.PACKAGE_ADDED");
    registerReceiver(this.mPluginInstallSuccessReceiver, filter);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:LetvApplication.java

示例15: onStart

import android.content.IntentFilter; //导入方法依赖的package包/类
@Override
protected void onStart() {
    super.onStart();
    receiver = new Receiver();
    IntentFilter intentFilter = new IntentFilter();
    intentFilter.addAction("android.intent.action.PACKAGE_ADDED");
    intentFilter.addAction("android.intent.action.PACKAGE_REMOVED");
    intentFilter.addDataScheme("package");
    this.registerReceiver(receiver, intentFilter);
}
 
开发者ID:TAnsz,项目名称:MyTvLauncher,代码行数:11,代码来源:AppUninstallActivity.java


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