The first release of the MyScrobbles application has now been released to Google Play. My Scrobbles is a quick and easy way to to browse yours and your friends LastFM listening history. You simply log in with your Last fm details and then all of your Scrobbles are displayed.
0 Comments
I recently made a major update to my LFCHistory Android app. Most of the work involved replacing the current UI to use SherlockActionBar. I spent a couple of weeks working on the changes and tested them on a Galaxy Nexus, Nexus 7 and Nexus 10. Everything was looking fine so I decided to release the application to Google Play. After several hours and a number of people started updating to the latest version of the app I started to get a lot off error alerts from my ACRA Crash reporting. All of them were from Xperia (SEMC) devices failing to open up the first activity. Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f0c0059 at android.content.res.Resources.getValue(Resources.java:896) at android.content.res.Resources.getDrawable(Resources.java:584) at android.widget.AbsListView.setFastScrollThumb(AbsListView.java:794) at android.widget.AbsListView.setFastScrollEnabled(AbsListView.java:740) at android.widget.AbsListView.<init>(AbsListView.java:670) at android.widget.ListView.<init>(ListView.java:167) at android.widget.ListView.<init>(ListView.java:163) It turns out that the resource ID used for the ListView scroller does not exist within the Xperia rom, which means as soon as the LisView tries to load the exception is thrown and the app fails. At first I fixed this by setting: android:fastScrollEnabled=”false” <ListView android:id="@+id/lv" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fadingEdge="vertical" android:fastScrollEnabled="false" android:scrollbars="vertical" /> This fixed the issue but then meant that all the other users without Xperia devices were now missing out on functionality (The app contains some large lists which can take a long time to move through without fast scroll being enabled). To fix this I decided to do a check in the code to see if the device being used was an Xperia, if it was not then the fast scroll can be enabled. e.g. if (!android.os.Build.BRAND.equalsIgnoreCase("SEMC")) { listView.setFastScrollEnabled(true); } This means that for everyone apart from Xperia users the fast scroll will now work. Note, the fast scrolling used to work on Xperia devices before I made the changes to work with ActionBarSherlock. |
MeI am a Liverpool supporting software developer originally from North Wales, now living and working in Manchester. Archives
May 2019
Categories
All
|