Killing app (pid 1724) because provider is in dying process

前端 未结 5 706
南方客
南方客 2021-02-03 11:58

A Provider is implemented in application and application updates provider data and triggers a remote service which queries the provider to retrieve the stored values.The appli

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-03 12:44

    try this solution:

    Context ctx = context.createPackageContext("package of the provider", Context.CONTEXT_IGNORE_SECURITY);
    cursor = ctx.getContentResolver().query(uri, null, null, null, null);
    // do something with cursor 
    

    And it had not restarted the main process when the package uninstalling, that supply the provider...

提交回复
热议问题