GPS サービスを実行していますが、現在の場所を以前にデータベースに保存した場所と比較できません。アプリは正常に動作していますが、onLocationChange() で記述された関数を取り出すと、コメントから外れてクラッシュします。
機能は次のとおりです。
LocationsDB db = new LocationsDB(this);
Cursor c = db.getAllLocations();
c.moveToFirst();
while(c.moveToNext()) {
arlist.add(c.getString(c.getColumnIndex("FIELD_LNG")));
arlistlat.add(c.getString(c.getColumnIndex("FIELD_LAT")));
}
for(int i=0;i<arlist.size();i++){
if(arlist.get(i)==Double.toString(location.getLongitude()) && arlistlat.get(i)==Double.toString(location.getLatitude())){
Intent myIntent=new Intent(GPSTracker.this,alarm.class);
startActivity(myIntent);
}
}