Check if the fragment is still attached to the activity in setConnected.

"java.lang.IllegalArgumentException: ... not attached to window manager"
errors have occurred (in the clearConnectingDialog case) because of a race
condition between this callback being called and the hosting activity
being destroyed.
Set ProgressBar default visibility to gone.

Otherwise it will show if the device is re-oriented, and there is no new
data to show (onItemsReceived, which sets the visibility, is not called).
Remove unused resource strings.
Explcitly set allowBackup to true (the default value).

Quiet's a warning in AndroidStudio.
Suppose a warning in the license.

The analyzer thinks that "(c)" in the list of redistribution requirements
could be replaced by the copyright symbol.
Remove unnecessary "return" statements.
Remove unused imports.