Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我安装应用程序的新版本时,我想以编程方式删除应用程序以前版本的缓存和所有详细信息。你怎么做到这一点?
首先确定当前应用程序是旧版本,然后通过以下方式将其删除:
Uri packageURI = Uri.parse("package: your.application.package"); Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI); startActivity(uninstallIntent);