在我的EditText
我想輸入第一個字符作爲alpha,剩下的就是什麼。我在TextWatcher
的幫助下完成了這項任務。但現在我的問題是,如果我輸入了錯誤的東西(比如數字,特殊字符)作爲我的第一個字符,那麼我的EditText
不應該接受剩餘的字符。如果我糾正了我的第一個字符,那麼只有我的EditText
應該接受。他們有可能實現這個朋友嗎?如果是的話請引導我的朋友。EditText的第一個處理器應該是字母表
我textWatcher代碼是提前
edittext.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence s, int start, int before, int count) {
// TODO Auto-generated method stub
}
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub
}
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
if (s.length() > 0) {
String str = edittext.getText().toString();
char t = str.charAt(0);
if (!Character.isLetter(t)) {
Toast.makeText(getApplicationContext(),
"please enter your first charecter as alpha",
Toast.LENGTH_LONG).show();
}
}
}
});
感謝。
我們需要更好地描述您的問題。這是什麼意思「*表格本身*」?你問關於'SELECT'查詢來找到重複? – 2013-04-10 07:23:47
您正在尋找什麼樣的期望輸出?你想選擇那些重複的,還是那些有獨特的? – 2013-04-10 07:25:18
@praveen你的查詢將只爲一列值的工作...對於例如:我想插入多個開發人員在部門,但不能允許多個頭/部門...... – Gunaseelan 2013-04-10 07:28:22