package com.example.temp_application;
import java.util.ArrayList;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
final ListView myLV = (ListView)findViewById(R.id.myLV);
final EditText myET = (EditText)findViewById(R.id.myET);
final ArrayList<String> todoList = new ArrayList<String>();
final ArrayAdapter<String> aa = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, todoList);
myLV.setAdapter(aa);
}
我收到错误:
令牌上的语法错误、错位的构造、令牌“aa”上的语法错误、此令牌 MainActivity.java 后预期的 VariableDeclaratorId
在这条线上
myLV.setAdapter(aa);