dronekit / dronekit-android

Android DroneKit implementation
http://android.dronekit.io/
263 stars 245 forks source link

Failing to connect using newUdpConnection(null) #474

Closed abencomo closed 7 years ago

abencomo commented 7 years ago

I'm using the newUdpConnection(null) method, but it never connects because droneApi.executeAsyncAction() is never executed since this.droneApiRef is always null.

@Override
protected void onResume() {
    super.onResume();

    if(this.drone.isConnected()) {
        this.drone.disconnect();
    } else {
        ConnectionParameter connectionParams = ConnectionParameter.newUdpConnection(null);
        this.drone.connect(connectionParams);
    }
    if(this.drone.isConnected()) {
        alertUser("Drone Connected");
    }
}
screen shot 2017-04-06 at 9 44 58 pm screen shot 2017-04-06 at 9 46 13 pm
abencomo commented 7 years ago

Never mind. The TowerListener is required for this.droneApiRef to be initialized.