次のような配列があります。
this.ntpServers[0][0] = "Global";
this.ntpServers[0][1] = "pool.ntp.org";
this.ntpServers[1][0] = "Africa";
this.ntpServers[1][1] = "africa.pool.ntp.org";
this.ntpServers[2][0] = "Asia";
this.ntpServers[2][1] = "asia.pool.ntp.org";
this.ntpServers[3][0] = "Europe";
this.ntpServers[3][1] = "europe.pool.ntp.org";
this.ntpServers[4][0] = "North America";
...
this.ntpServers[85][0] = ...
this.ntpServers[85][1] = ...
別の文字列に国があり、次のコードを使用してリストに存在するかどうかを比較しようとしていますが、真でなければならないときに真を返しません。「アジア」にチェックを入れると、本当です。しかし、何かが間違っています。
gettedCountry は文字列です
public int existNTP(String[][] list) {
if(Arrays.asList(list).contains(gettedCountry)){
Log.i("Found", "Found");
}
return position;
}
お手伝いありがとうございます。