→ LaPass:自己去記錄是不是第一次起動啦.... = = 09/20 19:08
所以不是要用特定的函式囉?
我以為要CALL函式 那我再試看看
謝謝L大 哈哈 讓你見笑了XDD
※ 編輯: rockerwind 來自: 140.118.206.169 (09/20 19:14)
推 nvidia:ANDROID SDK的API沒有這種功能,要自己實作囉XD 09/20 20:31
那可以再請問一個問題
private void openOptionsDialog(){
AlertDialog.Builder dialog = new AlertDialog.Builder(menu.this);
dialog.setTitle("寵物照顧系統");
dialog.setMessage("請輸入寵物的名字" );
dialog.setPositiveButton("OK",new DialogInterface.OnClickListener(){
public void onClick(
DialogInterface dialoginterface, int i){
}
});
if (petname.equals(null)){
dialog.show();
}
}
code 如上
為什麼我加上了 if () 這個指令後 就錯誤了呢?
謝謝 !!!
※ 編輯: rockerwind 來自: 140.118.206.169 (09/20 20:41)
→ asilzheng:如果 petname 真是 null 這樣會丟 NullPointerException 09/20 20:52
→ asilzheng:if (petname == null || petname.equals("")) {} 09/20 20:54
→ rockerwind:謝謝 我會試看看 09/21 20:48
→ rockerwind:修改完 可以執行 可是沒有達到功能 09/22 13:37
→ jack089452:用preference 09/22 13:40