ApplicationBroadcastService.class ファイルへの私のコードは次のとおりです。
public class ApplicationBroadcastService extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Activity a=new Activity();
Toast.makeText(context, " Uninstall ", Toast.LENGTH_LONG).show();
ContentValues values = new ContentValues();
values.put(ContactsContract.Groups._ID, 4444);
a.getContentResolver().delete(ContactsContract.Groups.CONTENT_URI,
values.toString(),null)
}
}
そしてmenifest.xmlのコードは次のとおりです。
<receiver android:name=".ApplicationBroadcastService">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_CHANGED" />
<action android:name="android.intent.action.PACKAGE_INSTALL" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
しかし、アプリケーションをアンインストールすると、通知が届きません。実際には、インストール時に作成された連絡先グループを受信通知で削除したいと考えています。そのための提案はありますか?