knjk04 / Bookshelf

Android book wishlist app
GNU General Public License v3.0
1 stars 1 forks source link

App crashes if there is no network connection #5

Closed knjk04 closed 6 years ago

knjk04 commented 6 years ago

This used to be handled in MainActivity. An alert dialog informing the user that there isn't a network connection should appear. This code is now in SearchableActivity, but does not appear.

knjk04 commented 6 years ago

Fixed with commit https://github.com/knjk04/Bookshelf/commit/b08c0a2b78593f9ed2e69380729d23d3725923f7

The problem was the wrong layout was being called for the first argument in the snackbar. I also fixed a bug (that I previously didn't know about) where if you pressed the go button without an active internet connection, the app would crash. The snackbar code is called for both cases (extracted to a method)