我找不到如何刪除這些錯誤在下面的代碼錯誤編譯Java代碼
package com.example.hellocodelearn;
import java.util.ArrayList;
import java.util.List;
import android.app.ListActivity;
import android.support.v7.app.ActionBarActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.example.hellocodelearn.models.Notes;
public class NotesListActivity extends ListActivity
{
private ArrayAdapter NotesItemArrayAdapter ;
private List<Notes> notes = new ArrayList<Notes>() ;
for (int i = 0; i < 20; i++)
{
Notes tweet = new Notes();
tweet.setTitle("A nice header for Tweet # " +i);
tweet.setBody("Some random body text for the tweet # " +i);
notes.add(tweet);
}
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notes_list);
NotesItemArrayAdapter = new NotesAdapter(this, new String[10]);
setListAdapter(NotesItemArrayAdapter);
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id)
{
Intent intent = new Intent(this, NotesDetailActivity.class);
startActivity(intent);
}
}
我得到的錯誤:
Description Resource Path Location Type
Syntax error on token ",", ; expected NotesListActivity.java /HelloCodeLearn/src/com/example/hellocodelearn line 47 Java Problem
普萊斯help.Thanks。
多虧了它................ – 2014-10-03 15:40:54