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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user