這應該是一個相當簡單的問題來回答。我環顧四周,找不到任何有關此語法的主題,並且「...」在Google上搜索它很困難。我正在研究一個簡單的測試應用程序,用於將數據庫文件從未受保護的Android手機上的受保護位置複製到SD卡上的一個位置,我可以通過該位置查看sqlite3 database viewing tool。我知道這似乎是一種迂迴的做事方式,但模擬器拒絕在我的上網本上打開,所以我現在用我的手機來測試開發。語法「final String ... args」是什麼意思/做什麼?
該代碼已被寫入,所以我borrowing it from here並適應它到我的代碼。我遇到的這個代碼小片段:
private class ExportDatabaseFileTask extends AsyncTask<String, Void, Boolean> {
private final ProgressDialog dialog = new ProgressDialog(ManageData.this);
// can use UI thread here
protected void onPreExecute() {
this.dialog.setMessage("Exporting database...");
this.dialog.show();
}
// automatically done on worker thread (separate from UI thread)
protected Boolean doInBackground(final String... args) {
我從來沒有見過的說法final String... args
之前。這意味着什麼?
謝謝! Moscro
非常好,謝謝大家的幫忙! – moscro 2011-02-26 05:27:29