I have the following set-up
public class MainActivity extends AppCompatActivity implements LocationListener {
GeoPoint pointTarget;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
pointTarget.setLatitude(51.4245);
pointTarget.setLongitude(3.1455);
}
}
This throws Attempt to invoke virtual method 'void org.osmdroid.util.GeoPoint.setLatitude(double)' on a null object reference
at pointTarget.setLatitude(51.4245);
The two arguments are doubles, so that can't be the problem. pointTarget
has also been instantiated. Can anyone please tell me what is wrong?