# HG changeset patch # User Marseille # Date 1264950169 -3600 # Node ID 92aff14fc1e7f3b747478953e4df38097f6995f7 # Parent f98ef87c34b8a2cfa6e2db80928c4fab51fbbc21 bug ui status fix. diff -r f98ef87c34b8 -r 92aff14fc1e7 src/com/beem/project/beem/ui/ChangeStatus.java --- 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(); } } }