2011-05-31 40 views
1

我做了一個Android應用程序。其中一個部分是登錄。在這個活動中,我有一個名爲密碼的EditText。按登錄按鈕後,它會打開一個新的活動,準備做其他事情。如果驗證服務器上的密碼失敗,我將完成()新的活動並返回到舊的活動。我想清除已輸入的密碼。所以我在onResume()方法中使用password.setText(「」)。在onResume函數中添加password.setText(「」)後,爲什麼editText無法輸入?

但是如果我多次輸入錯誤的密碼,如你所見,活動打開和關閉幾次,EditText上密碼無法輸入任何東西,直到我關閉活動,然後再次打開它。

這裏是logcat的信息:

05-31 16:11:30.067: VERBOSE/WindowManager(2335): Remove Window{47cd7058 com.nationz.szt/com.nationz.szt.ChargeFromRelate2 paused=false}: mSurface=Surface(name=com.nationz.szt/com.nationz.szt.ChargeFromRelate2, identity=691) mExiting=false isAnimating=false app-animation=null inPendingTransaction=false mDisplayFrozen=false 
05-31 16:11:30.067: ERROR/WindowManager(2335): return in removeWindowLocked 
05-31 16:11:33.657: VERBOSE/WindowManager(2335): Remove Window{478bad38 com.nationz.szt/com.nationz.szt.ChargeFromRelate2 paused=true}: mSurface=Surface(name=com.nationz.szt/com.nationz.szt.ChargeFromRelate2, identity=693) mExiting=false isAnimating=true app-a[email protected]477d7c40 inPendingTransaction=true mDisplayFrozen=false 
05-31 16:11:33.657: ERROR/WindowManager(2335): return in removeWindowLocked 
05-31 16:11:33.677: INFO/[POST_RESELECT](5092): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=([email protected],-1,0,-1,0) 
05-31 16:11:33.677: INFO/[POST_RESELECT](5092): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=([email protected],-1,0,-1,0) 
05-31 16:11:33.677: DEBUG/InputManagerService(2335): Starting input on non-focused client [email protected] (uid=10094 pid=5092) 
05-31 16:11:33.707: DEBUG/InputManagerService(2335): Window already focused, ignoring focus gain of: [email protected] 
05-31 16:11:33.777: VERBOSE/WindowManager(2335): Remove Window{47bc8f88 com.nationz.szt/com.nationz.szt.ChargeFromRelate2 paused=false}: mSurface=Surface(name=com.nationz.szt/com.nationz.szt.ChargeFromRelate2, identity=692) mExiting=true isAnimating=true [email protected] inPendingTransaction=false mDisplayFrozen=false 
05-31 16:11:33.777: ERROR/WindowManager(2335): return in removeWindowLocked 
05-31 16:11:34.557: DEBUG/FriendStreamWidgetView(2483): handleReceivedIntent SIP isCurrentlyVisisble=true 
05-31 16:11:35.439: WARN/IInputConnectionWrapper(5092): beginBatchEdit on inactive InputConnection 
05-31 16:11:35.439: WARN/IInputConnectionWrapper(5092): commitText on inactive InputConnection 
05-31 16:11:35.439: WARN/IInputConnectionWrapper(5092): InputConnection = null, active client = true 
05-31 16:11:35.439: WARN/IInputConnectionWrapper(5092): endBatchEdit on inactive InputConnection 
05-31 16:11:36.187: WARN/IInputConnectionWrapper(5092): beginBatchEdit on inactive InputConnection 
05-31 16:11:36.187: WARN/IInputConnectionWrapper(5092): commitText on inactive InputConnection 
05-31 16:11:36.187: WARN/IInputConnectionWrapper(5092): InputConnection = null, active client = true 
05-31 16:11:36.187: WARN/IInputConnectionWrapper(5092): endBatchEdit on inactive InputConnection 
05-31 16:11:36.547: WARN/IInputConnectionWrapper(5092): beginBatchEdit on inactive InputConnection 
05-31 16:11:36.547: WARN/IInputConnectionWrapper(5092): commitText on inactive InputConnection 

有人知道爲什麼嗎? 順便說一句:如果我刪除password.setText(「」)部分。它會正常工作。

+1

你爲什麼不燒結過程掀起了新活動之前輸入的數據?我在具有登錄模塊的應用程序中遵循該模式。 – nahwarang 2011-05-31 08:36:18

回答

相關問題