private void InitData () {//Displays the current user name on the button Bt_setting_out.settext ("Exit login (" + emclient.getinstance (). Getcurrentuser () + ")");//Log out of the logical processing Bt_setting_out.setonclicklistener (new View.onclicklistener () {@Overridepublic void OnClick (View v) {model.getinstance (). Getglobalthreadpool (). Execute (new Runnable () {@Overridepublic void Run () {// Log on to the Ring mail server to exit login emclient.getinstance (). Logout (False, new Emcallback () {@Overridepublic void onsuccess () {// Close Dbhelpermodel.getinstance (). Getdbmanager (). Close (); Getactivity (). Runonuithread (New Runnable () {@Overridepublic void Run () {//Update UI Display Toast.maketext (Getactivity (), "Exit succeeded", Toast.length_short). Show ();//Return to login page Intent intent = new Intent (Getactivity (), loginacitivity.class); startactivity (Intent); Getactivity (). Finish ();}}); @Overridepublic void OnError (int i, final String s) {getactivity (). Runonuithread (New Runnable () {@Overridepublic void run () {Toast.maketext (getactivity (), "Exit failed" + S, Toast.length_short). Show ();});} @Overridepublic void onprogress (int i, string s) {}});});}
User name becomes uppercase workaround (android:textallcaps= "false")
<button android:id= "@+id/bt_setting_out" android:text= "Exit" android:textsize= "20sp" android: Textallcaps= "false" android:textcolor= "@android: Color/white" android:background= "@android: Color/holo_ Red_light " android:layout_width=" match_parent " android:layout_height=" 60DP "/>
Silicon Valley Social 4--settings page