開発中の天気アプリに問題があります。コンストラクターはリストを作成することになっていますが、アプリを実行すると空白の画面が表示されます。
ERROR:
';' expected
no suitable constructor found for List(javax.microedition.lcdui.List)
constructor javax.microedition.lcdui.List.List(java.lang.String,int,java.lang.String[],javax.microedition.lcdui.Image[]) is not applicable
(actual and formal argument lists differ in length)
constructor javax.microedition.lcdui.List.List(java.lang.String,int) is not applicable
(actual and formal argument lists differ in length)
//コンストラクタを持つクラス
public class WeatherMIDlet extends BaseMIDlet implements CommandListener {
private List list3;
private List getWeatherLocationView(List list3) {
if (weatherConditionSearch == null) {
weatherConditionSearch = new WeatherConditionSearch(this, list3);
}
return weatherConditionSearch; //list should dislay here!
}
// 地方都市のリストを作成したいクラス
public class WeatherConditionSearch extends List implements CommandListener {
private Command okCmd, backCmd;
private TextField locationTfld;
private BaseMIDlet midlet;
private List list;
public WeatherConditionSearch(BaseMIDlet midlet, List list3) //super class is List
{
super(list3);//error is at this line
this.midlet = midlet;
lists();
addCommand(okCmd);
addCommand(backCmd);
setCommandListener(this);
}
private void lists() {
okCmd = new Command("Get", Command.OK, 0);
backCmd = new Command("Back", Command.BACK, 1);
if (list == null) {
list = new List("Cities", Choice.IMPLICIT);
list.append("Kampala", null);
list.append("Entebbe", null);
list.append("Mubende", null);
list.setCommandListener(this);
list.setSelectedFlags(new boolean[]{false, false, false});
}