Fix authorization osmo

This commit is contained in:
vshcherb 2014-05-16 02:11:01 +03:00
parent 3c7a418707
commit 04a2acf5a1
2 changed files with 8 additions and 5 deletions

View file

@ -100,6 +100,9 @@ public class OsMoPlugin extends OsmandPlugin implements MonitoringInfoControlSer
};
@Override
protected void onPostExecute(Exception result) {
if(dlg.isShowing()) {
dlg.dismiss();
}
if (result != null) {
result.printStackTrace();
app.showToastMessage(app.getString(R.string.osmo_io_error) + result.getMessage());
@ -110,10 +113,7 @@ public class OsMoPlugin extends OsmandPlugin implements MonitoringInfoControlSer
@Override
protected Exception doInBackground(Void... params) {
if(dlg.isShowing()) {
dlg.dismiss();
}
return OsmandPlugin.getEnabledPlugin(OsMoPlugin.class).registerOsmoDeviceKey();
return registerOsmoDeviceKey();
}
};
}

View file

@ -27,6 +27,7 @@ public class SettingsOsMoActivity extends SettingsBaseActivity {
uuid = new Preference(this);
uuid.setTitle(R.string.osmo_settings_uuid);
uuid.setSummary(getMyApplication().getSettings().OSMO_DEVICE_KEY.get().toUpperCase());
uuid.setOnPreferenceClickListener(this);
grp.addPreference(uuid);
@ -39,9 +40,11 @@ public class SettingsOsMoActivity extends SettingsBaseActivity {
OsMoPlugin.getEnabledPlugin(OsMoPlugin.class).getRegisterDeviceTask(this, new Runnable() {
@Override
public void run() {
updateAllSettings();
updateAllSettings();
uuid.setSummary(getMyApplication().getSettings().OSMO_DEVICE_KEY.get().toUpperCase());
}
}).execute();
return true;
}
return super.onPreferenceClick(preference);
}