public void run() { try { final String version = mVehicleManager.getVehicleInterfaceVersion(); final String deviceId = mVehicleManager.getVehicleInterfaceDeviceId(); final String platform = mVehicleManager.getVehicleInterfacePlatform(); getActivity().runOnUiThread(new Runnable() { public void run() { mViDeviceIdView.setText(deviceId); mViVersionView.setText(version); mViPlatformView.setText(platform); } }); } catch (NullPointerException e) { // A bit of a hack, should probably use a lock - but // this can happen if this view is being paused and it's // not really a problem. } } }).start();