Update tab refreshes correctly now.
Before it was listening for changes, but we weren't notifying of changes correctly. Now we use ContentResolver.notifyChange().
This commit is contained in:
parent
bfdfb6d5ef
commit
9703350f41
@ -909,7 +909,7 @@ public class AppDetails extends ListActivity {
|
|||||||
Uri uri = Uri.fromParts("package", pkginfo.packageName, null);
|
Uri uri = Uri.fromParts("package", pkginfo.packageName, null);
|
||||||
Intent intent = new Intent(Intent.ACTION_DELETE, uri);
|
Intent intent = new Intent(Intent.ACTION_DELETE, uri);
|
||||||
startActivityForResult(intent, REQUEST_UNINSTALL);
|
startActivityForResult(intent, REQUEST_UNINSTALL);
|
||||||
((FDroidApp) getApplication()).invalidateApp(id);
|
notifyAppChanged(id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -927,7 +927,15 @@ public class AppDetails extends ListActivity {
|
|||||||
"application/vnd.android.package-archive");
|
"application/vnd.android.package-archive");
|
||||||
extraNotUnknownSource(intent);
|
extraNotUnknownSource(intent);
|
||||||
startActivityForResult(intent, REQUEST_INSTALL);
|
startActivityForResult(intent, REQUEST_INSTALL);
|
||||||
((FDroidApp) getApplication()).invalidateApp(id);
|
notifyAppChanged(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We could probably drop this, and let the PackageReceiver take care of notifications
|
||||||
|
* for us, but I don't think the package receiver notifications are very instantaneous.
|
||||||
|
*/
|
||||||
|
private void notifyAppChanged(String id) {
|
||||||
|
getContentResolver().notifyChange(AppProvider.getContentUri(id), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void launchApk(String id) {
|
private void launchApk(String id) {
|
||||||
|
@ -22,6 +22,7 @@ import android.content.BroadcastReceiver;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import org.fdroid.fdroid.data.AppProvider;
|
||||||
|
|
||||||
public class PackageReceiver extends BroadcastReceiver {
|
public class PackageReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
@ -29,7 +30,7 @@ public class PackageReceiver extends BroadcastReceiver {
|
|||||||
public void onReceive(Context ctx, Intent intent) {
|
public void onReceive(Context ctx, Intent intent) {
|
||||||
String appid = intent.getData().getSchemeSpecificPart();
|
String appid = intent.getData().getSchemeSpecificPart();
|
||||||
Log.d("FDroid", "PackageReceiver received "+appid);
|
Log.d("FDroid", "PackageReceiver received "+appid);
|
||||||
((FDroidApp) ctx.getApplicationContext()).invalidateApp(appid);
|
ctx.getContentResolver().notifyChange(AppProvider.getContentUri(appid), null);
|
||||||
Utils.clearInstalledApksCache();
|
Utils.clearInstalledApksCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user