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.
Google Map in MapGL
Recently, I found Google Map released MapGL Beta Version. I tried that. It does not looks any different from the classic mode. But when I changes the zoom level, that is smoother and some tweening effect too. That sounds cool. I started to use this mode as the default.
Ping won't work for external network in Android
The standard way to do Ping in Android is using isReachable().
Like this:
Code
InetAddress address = InetAddress.getByName("192.168.1.1")); | |
if(address.isReachable(100000)){ | |
// Success} |
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
Code
<uses-permission android:name="android.permission.INTERNET"></uses-permission> |
Well, I found that is because I placed this tag under manifest element. I should place it under the receiver element
Code
<receiver android:name="Widget" > | |
<uses-permission android:name="android.permission.INTERNET"></uses-permission> |
Finally the problem is solved.
Google I/O 2012 Key Note is uploaded
I am watching the key note for Google I/O 2012. There are Android 4.1 and Project Butter.
Find out more on Youtube