In Android應用程序開發傻瓜我在最後一段代碼後出現錯誤。Android for Dummies代碼錯誤
方法
setListAdapter(ArrayAdapter<String>)
是未定義類型ReminderListActivity
的代碼如下:
package com.dummies.android.taskreminder;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
public class ReminderListActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.reminder_list);
String[] items = new String[] { "Foo", "Bar", "Fizz", "Bin"};
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this, R.layout.reminder_row, R.id.text1, items);
setListAdapter(adapter);
}
}
謝謝你,沒有解決我的問題 – Piggie2009
我仍然認爲我的回答是更好的:P –
這是一個很好的,如果對稱競爭。 (我贏得理由我甚至沒有擁有Android設備,我也沒有寫過任何android代碼?) – andersoj