bug ui status fix.
--- a/src/com/beem/project/beem/ui/ChangeStatus.java Sun Jan 31 15:41:27 2010 +0100
+++ b/src/com/beem/project/beem/ui/ChangeStatus.java Sun Jan 31 16:02:49 2010 +0100
@@ -180,7 +180,7 @@
* @return the status index from status the settings.
*/
private int getPreferenceStatusIndex() {
- return mSettings.getInt("PreferenceStatus", 0);
+ return mSettings.getInt(getString(R.string.PreferenceStatus), AVAILABLE_IDX);
}
/**
@@ -276,24 +276,27 @@
int status = getStatusForService((String) mSpinner.getSelectedItem());
Editor edit = mSettings.edit();
edit.putString(getString(R.string.PreferenceStatusText), msg);
- edit.putInt(getString(R.string.PreferenceStatus), mSpinner.getSelectedItemPosition());
- edit.commit();
+
if (status == Status.CONTACT_STATUS_DISCONNECT) {
stopService(new Intent(ChangeStatus.this, BeemService.class));
+ edit.putInt(getString(R.string.PreferenceStatus), AVAILABLE_IDX);
} else {
try {
mXmppFacade.changeStatus(status, msg.toString());
+ edit.putInt(getString(R.string.PreferenceStatus), mSpinner.getSelectedItemPosition());
} catch (RemoteException e) {
e.printStackTrace();
}
mToast.show();
}
+ edit.commit();
}
ChangeStatus.this.finish();
} else if (v == mClear) {
mStatusMessageEditText.setText(null);
} else if (v == mContact) {
startActivity(new Intent(ChangeStatus.this, ContactList.class));
+ ChangeStatus.this.finish();
}
}
}