Treat SqueezerItems with getId() == null as identical.

Fixes a problem when connecting to a server with no currently playing
song -- the "current" song and "new" song weren't comparing as equal,
resulting in repeated calls to updateOngoingNotification().

Add unit tests to verify that equals() works as expected.
Merge remote-tracking branch 'kaaholst/actionbar' into actionbar
Fix an NPE when togglePausePlay() is called with no connected players.
Save and restore itemlist contents + position on orientation changes.

- Create a RetainFragment that backs a hash that can be used to get/put
  arbitrary objects, and use this in multiple places to save state across
  the activity life cycle.


framework/SqueezerItemListActivity.java:

- Maintain a set of pages that have been received from the server, distinct
  from the set of pages that have been ordered.  Use the RetainFragment to
  persist this across activity pauses.

- Rename reorderItems() to clearAndReorderItems() to make the code more
  documenting, clear the sets of received and ordered pages, and re-fetch
  page 0 when it's called.


framework/SqueezerBaseListActivity.java:

- Use the RetainFragment to persist and restore the state of the itemView,
  imageFetcher, adapter, and listview.


itemlists/Squeezer*Activity.java:
itemlists/dialogs/*.java:

- s/orderItems()/clearAndReOrderItems()/


util/ImageCache.java:

- Use the new util.RetainFragment, and delete the retain fragment inner
  class from this class.


util/RetainFragment.java:

- A Fragment designd to be retained across activity boundaries.  It can
  store and retrieve arbitrary objects under a given key.
Remove two unnecessary semi-colons.
Ignore out/ and *.patch.

out/ is created by gradle/Android Studio.

*.patch are generated from Android Studio's "Create patch" feature.
Restore functionality to show loading progress in list activities.

As the activity may start with cached state this cannot blindly show the
progress indicator.  Adjust SqueezerItemListActivity::maybeOrderPage() to
return a boolean indicating whether or not the page was ordered.

Override this in SqueezerBaseListActivity::maybeOrderPage(), and if page 0
was requested then hide the listview and make the loading progress indicator
visible.
Merge branch 'actionbar' of https://github.com/nikclayton/android-squeezer into actionbar
Add a "wrapper" task, expected by Android Studio.
Correct the name of the final parameter.
Clean up whitespace, add comments for future work.
Add a tools:layout entry for Android Studio's UI builder view.
Catch ActivityNotFound when requesting a scrobbling app.

This will happen on any device without a market:// URI handler
installed.
Fix a bug where searches from the search activity did not work.

The previous code called maybeOrderPage(0), but since page 0 had been fetched
it was not refetched, and so second and subsequent attempts to search would
leave the loading view spinning indefinitely.

Fix this by calling clearAndReOrderItems() instead.  Do this after the
loading label has been made visible so that the clearing of the results
does not happen visibly to the user.

Add some comments while I'm here.
Enable voice searches.
Fix a bug where all option menu items were being shown.

Different versions of Android call onCreateOptionsMenu() at different times,
which may be either before or after the service connection has completed.

The code that toggles state checks to see if menu_item_connect is
non-null, and only toggles visibility if that is the case.  This meant that
the service connection might complete before onCreateOptionsMenu() ran,
menu_item_connect was null, and no toggling would take place.  This resulted
in (for example) the "Connect" menu item being visible even after connection
had completed.

Fix this by moving the toggling code in its own method and call it after
service connection has completed and in onCreateOptionsMenu.  This ensures
that the menu items are set correctly at either point.

While I'm here, rename the variables that reference the items, as the
"Button" suffix was misleading.
Include connection state when determining which power menu items to show.

Fixes a bug where Power on/off could appear in the menu when there was
no connection to the server.
Fix BadTokenExceptions with VolumePanel.

The panel's display could happen while the activity hosting the
NowPlayingFragment was finishing, or finished.  Include an explicit check
for this before showing the dialog, and ensure the dialog is dismissed
when the fragment is paused.