Я хочу знать, если пользователь из моего приложения установит другое приложение, это мой код: я создаю NewInstallReceived Activity
class NewInstallReceiverActivity extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String act = intent.getAction();
Log.d("DetectNewApp", "new install" + intent);
if (Intent.ACTION_PACKAGE_ADDED.equals(act) || Intent.ACTION_PACKAGE_REMOVED.equals(act)) {
/* ContentResolver contentResolver = context.getContentResolver();
contentResolver.query()*/
}
}
}
в Android Манифест
<receiver android:name=".NewInstallReceiverActivity">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED"/>
<action android:name="android.intent.action.PACKAGE_INSTALL"/>
<data android:scheme="package" />
</intent-filter>
</receiver>
когда я устанавливаю случайное приложение, в моем debug.log ничего не отображается, какое-либо решение?