Archives for: "January 2015"
Id in onItemClick is not your Object Id
public abstract void onItemClick (AdapterView<?> parent, View view, int position, long id) in AdapterView Last parameter calls id, but that will be row id, not the data object id in item. You should use position and getItemAtPosition to get the data… more »
findViewById in Fragment
In Fragment sub class in Android, you cannot directly use .findViewById() to retrieve the control from view , similar with Activity. You need to do a single small step, using this.getView().
E.g. more »
Navigation Drawer is not opening by clicking the app icon
I spent three days about this problem. The Navigation Drawer will show if I swipe the screen from left to right. But that won't show by clicking the app icon. Actually, I missed these lines of codes: Codepublic boolean onOptionsItemSelected(MenuItem… more »
Error:No GMSG handler found for GMSG
I added Google Play Ads Service. However, I got this error: "No GMSG handler found for GMSG". No ads is displayed at all. I found the reason, that is because my app has not put in the play store. So, I have to add the my emulator as a test device. Like… more »
Foreach in Java
I used foreach keyword in C#. I used it to travel element one by one in a list. In Java, there is not such keyword calls foreach. But you can use for to do that:
E.g.Codeforeach(Tag tag : tags){ tag.getName();} more »