Don't crash if no apks are listed
This commit is contained in:
parent
b9d5e8f701
commit
07a161c0a9
@ -456,29 +456,31 @@ public class AppDetails extends ListActivity {
|
|||||||
tv = (TextView) infoView.findViewById(R.id.summary);
|
tv = (TextView) infoView.findViewById(R.id.summary);
|
||||||
tv.setText(app.summary);
|
tv.setText(app.summary);
|
||||||
|
|
||||||
tv = (TextView) infoView.findViewById(R.id.permissions_list);
|
if (!app.apks.isEmpty()) {
|
||||||
|
tv = (TextView) infoView.findViewById(R.id.permissions_list);
|
||||||
|
|
||||||
CommaSeparatedList permsList = app.apks.get(0).detail_permissions;
|
CommaSeparatedList permsList = app.apks.get(0).detail_permissions;
|
||||||
if (permsList == null) {
|
if (permsList == null) {
|
||||||
tv.setText(getString(R.string.no_permissions) + '\n');
|
tv.setText(getString(R.string.no_permissions) + '\n');
|
||||||
} else {
|
} else {
|
||||||
Iterator<String> permissions = permsList.iterator();
|
Iterator<String> permissions = permsList.iterator();
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
while (permissions.hasNext()) {
|
while (permissions.hasNext()) {
|
||||||
String permissionName = permissions.next();
|
String permissionName = permissions.next();
|
||||||
try {
|
try {
|
||||||
Permission permission = new Permission(this, permissionName);
|
Permission permission = new Permission(this, permissionName);
|
||||||
sb.append("\t• " + permission.getName() + '\n');
|
sb.append("\t• " + permission.getName() + '\n');
|
||||||
} catch (NameNotFoundException e) {
|
} catch (NameNotFoundException e) {
|
||||||
Log.d( "FDroid",
|
Log.d( "FDroid",
|
||||||
"Can't find permission '" + permissionName + "'");
|
"Can't find permission '" + permissionName + "'");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
tv.setText(sb.toString());
|
||||||
}
|
}
|
||||||
tv.setText(sb.toString());
|
tv = (TextView) infoView.findViewById(R.id.permissions);
|
||||||
|
tv.setText(getString(
|
||||||
|
R.string.permissions_for_long, app.apks.get(0).version));
|
||||||
}
|
}
|
||||||
tv = (TextView) infoView.findViewById(R.id.permissions);
|
|
||||||
tv.setText(getString(
|
|
||||||
R.string.permissions_for_long, app.apks.get(0).version));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateViews() {
|
private void updateViews() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user