2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 06:05:12 +00:00

Fixed error list always empty the second time it is loaded.

This commit is contained in:
Albert Vaca
2014-09-23 16:42:26 +02:00
parent 4d1464484e
commit b0a632fe10

View File

@@ -57,13 +57,15 @@ public class DeviceActivity extends ActionBarActivity {
names[i] = p.getDisplayName();
}
ListView errorList = (ListView)findViewById(R.id.errors_list);
if (!failedPlugins.isEmpty() && errorList.getHeaderViewsCount() == 0) {
if (errorHeader == null) {
errorHeader = new TextView(DeviceActivity.this);
errorHeader.setPadding(0,24,0,0);
errorHeader.setText(getResources().getString(R.string.plugins_failed_to_load));
if (!failedPlugins.isEmpty()) {
if (errorList.getHeaderViewsCount() == 0) {
if (errorHeader == null) {
errorHeader = new TextView(DeviceActivity.this);
errorHeader.setPadding(0,24,0,0);
errorHeader.setText(getResources().getString(R.string.plugins_failed_to_load));
}
errorList.addHeaderView(errorHeader);
}
errorList.addHeaderView(errorHeader);
} else {
errorList.removeHeaderView(errorHeader);
}