rosjava / android_core

Android libraries for rosjava
144 stars 166 forks source link

Catch Error: E/Registrar: Exception caught while communicating with master. #308

Open carsonxw opened 5 years ago

carsonxw commented 5 years ago

I've tried overriding onMasterRegisterFailure in onStart() method. It was still not working as expected. App keeps crashes if users connect to Valid IP but failed to connect to Master.

publisher.addListener(new DefaultPublisherListener<std_msgs.String>() {
            @Override
            public void onMasterRegistrationSuccess(Publisher<std_msgs.String> registrant) {
                Log.w("Publisher:", "Publisher succeed to register: " + registrant);
            }
            @Override
            public void onMasterRegistrationFailure(Publisher<std_msgs.String> registrant) {
                Log.w("Publisher:", "Publisher failed to register: " + registrant);
            }
        });