我使用下面的代码在数据库中插入用户安装的应用程序包名称并成功插入在日志中显示我现在我想比较系统安装应用程序与此数据库值并仅显示数据酶中的值所以我如何比较?如果 (((p.packageName).equals("db.list???"))
DatabaseHandler db;
public boolean shouldOverrideUrlLoading(WebView view, String url) {
String Standard = "https://play.google.com/store/apps/details?id=";
String id= url.substring(Standard .length(), url.indexOf("&"));
db.addContact(new Contact(id));
public class FunActivity extends Activity implements OnItemClickListener {
DatabaseHandler db;
private List<App> loadInstalledApps(boolean includeSysApps) {
List<App> apps = new ArrayList<App>();
// the package manager contains the information about all installed apps
PackageManager packageManager = getPackageManager();
List<PackageInfo> packs = packageManager.getInstalledPackages(0);
for(int i=0; i < packs.size(); i++) {
PackageInfo p = packs.get(i);
if ( ((p.packageName).equals("db.list???")) //what i write here
App app = new App();
app.setTitle(p.applicationInfo.loadLabel(packageManager).toString());
app.setPackageName(p.packageName);
app.setVersionName(p.versionName);
app.setVersionCode(p.versionCode);
CharSequence description = p.applicationInfo.loadDescription(packageManager);
app.setDescription(description != null ? description.toString() : "");
apps.add(app);