Updating Keyboard Icon
<p>I am new to Android and Eclipse development, but not new to software development in general.</p>

<p>As my first real project, to get over the learning curve, I am modifying the SDK example soft keyboard to include a "macro" functionality.</p>

<p>The major functionality is working properly. But, I am having trouble getting the keyboard key icon to update in one of 2 situations.</p>

<p>I have created a function key, "Fn", that when I press followed by a letter key will insert one of my predefined strings into the edit field – like my e-mail address.</p>

<p>In the first situation, when I press the function key I change the icon to signify "function active". If I repeatedly press the function key, the icon changes back and forth between signifying active and inactive. This is correct.</p>

<p>In the second situation, I press the function key, the icon changes to signify "function active", then I press a letter key. The macro string is entered in whatever text field properly, in code I then change the "function" state to inactive and update the icon.</p>

<p>Using Logs I can see the code is executed to properly change the icon, but the icon does not change. It is still showing the "function active" state even though I see that the internal flag has changed to inactive and I can see that the key icon drawable was written properly to have the key show the "function inactive" state.</p>

<p>I have tried a whole bunch of different things – to no avail.</p>

<p>What is going on that prevents this key icon from updating in this situation?</p>

<p>Everything in the second situation seems to execute the same code as in the first situation – the case that works, repeatedly pressing the function key. I can think of one difference. When repeatedly pressing the function key, the function key has "focus". When I press the function key and then press a letter key, the letter key is the one with "focus". I don't know if this makes sense or not. I have tried looking for some kind of invalidate method, but I can't find anything.</p>

<p>Any hints or suggestions are very appreciated.</p>

<p>Thanks,
Barry.</p>
