Category: "Android programming"
Google Play Style Action Bar - ViewPagerIndicator
I want to add a Google Play Style Action Bar into my AdvGen ToDoList
acction. That will improve user interactions. I know that is doable in Android 3.0+, but I still want to Android 2.x. I know Android Support v4 can bring Action Bar into Android 2.x. It makes the solution is doable, but that is not a out of box library. I found ViewPagerIndicator opensource library. That make my life much easier!
onListItemClick is not working
You need to build a sub-class of ListActivity. Then you can override onListItemClick to catch the event on click when the list item is clicked. But that is not always working, if you use your custom list adapter and inside the adapter has any button, check box and image button. If the adapter has this kind of checkable item, they seems to be catch the click event before onListItemClick. So onListItemClick is not work.
I found this problem when I build my AdvGen To Do List.
Ping won't work for external network in Android
The standard way to do Ping in Android is using isReachable().
But I tested this only working in local network and total not working in emulator too!
I guess for external IP address, it will only work on rooted phones.
Moreover, I am thinking whether Mobile Provider will block ICMP Package too!
UnknownHostException in HttpGet at the android widget
I have used HttpGet a lot in Android, but today, I started to build my first android widget. I used HttpGet for accessing some external feeds. I got UnknownHostException. I have placed in the use-permission tag in AndroidManifest.xml
Well, I found that is because I placed this tag under manifest element. I should place it under the receiver element
Finally the problem is solved.
Resource Not Found in Android
I have tried to get a string resource via getResources().getString(R.string.msg_err). Under values/strings.xml. I am 100% sure there is msg_err value. But I still got Resource$NotFoundException. But after I added msg_err1 value in text view mode, that works. I found the problem it cannot get the value if you create key value pair in "Resources" Tab in the string.xml. That is very strange!