Java Code Examples for android.content.Intent.ACTION_PACKAGE_ADDED

The following are Jave code examples for showing how to use ACTION_PACKAGE_ADDED of the android.content.Intent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: nativead   File: AdInstallUtils.java   View Source Code Vote up 7 votes
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);
	}
}
 
Example 2
Project: VirtualHook   File: VAppManagerService.java   View Source Code Vote up 5 votes
private void sendInstalledBroadcast(String packageName) {
    Intent intent = new Intent(Intent.ACTION_PACKAGE_ADDED);
    intent.setData(Uri.parse("package:" + packageName));
    VActivityManagerService.get().sendBroadcastAsUser(intent, VUserHandle.ALL);
}
 
Example 3
Project: TPlayer   File: VAppManagerService.java   View Source Code Vote up 5 votes
private void sendInstalledBroadcast(String packageName) {
    Intent intent = new Intent(Intent.ACTION_PACKAGE_ADDED);
    intent.setData(Uri.parse("package:" + packageName));
    VActivityManagerService.get().sendBroadcastAsUser(intent, VUserHandle.ALL);
}