Wednesday, January 28, 2015

Spinner text not showing

   The spinner view was working great on newer Android versions . I decided to try on version 2.2, so I started up an emulator running 2.2 and that's when I noticed the trouble. The text in the spinner list was not showing up unless you clicked on it. The actions worked correctly and on other Android versions the text showed. So I tried setting color of text and background but that only effected the spinner and not the drop down list itself. The fix was changing the line:
adapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);

To:
adapter.setDropDownViewResource(android.R.layout.simple_expandable_list_item_1);

I'm still not sure why the first one did not work.

10,000 hour to Mastery.
10,000 - 631 = 9369 hours left

Tuesday, January 13, 2015

Lint tool

    Lint is an awesome Android tool that is almost never mentioned in Android books. I probably would never had known about it's uses had it not been the need to track down string resources that I needed to remove or translate. The problem began with me doing a beginners mistake, which is hard coding in strings. So I had to track down all of these. As I was doing this I was adding strings to the string.xml resource. In doing this I noticed a lot of strings that might not be needed but I did not want to delete them and perhaps creating a lot of errors. Once again Googling for solutions , I found the answer in the tool Lint. Surprisingly the tool does not run automatically ( there might be a way to set it so it does but I have not found it yet). You have to right click the project, select Android tools and then run Lint. It showed me a list which included  colors and strings not use, strings not translated, missing drawables and conflicting background color ( I was coloring a background that the theme already colored). I have just scratched the surface of what Lint can do. Now I am interested in what other tools are included that might be useful.

10,000 hour to Mastery.
10,000 - 623 = 9377 hours left

Not a lot of hours but I have learned so much.