现在我正在尝试创建一个 android onListItemClick 方法。但是每次我这样做时都会出现大量语法错误,说预期的分号。通常,当我遇到这样的语法错误时,我知道只需添加一个分号,但在这种情况下,我不知道应该如何将分号应用于这样的事情。首先,在这样的声明中是否应该有分号?这是代码
package net.androidbootcamp.coffeefinder;
import java.util.Calendar;
import android.os.Bundle;
import android.app.Activity;
import android.app.ListActivity;
import android.view.Menu;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class MainActivity extends ListActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Menu Select Array
String[] CoffeeShop = {"Creation","Starbucks","Caribou","Mo'Joe" };
//Set list adapter for list
setListAdapter(new ArrayAdapter<String>(this,R.layout.activity_main,R.id.Coffee,CoffeeShop));
//Create actions of list
protected void onListItemClick(ListView l, View v, int position, long id)
{
}