views:

4

answers:

1

Hi,

Am new to android, am developing application with websevices using json parsing with httpget method,cant use http post method in android actually.

It working fine normally, but many time it shows the error on emulator like activity not responding force close activity.when i put that url in browser it shows the result .but i don't know why this activity not responding error came.

I think the httprequest took more time to retrieve the data from server,but am not sure. any one help me to how to avoid this error or how to minimize this .

I want know what are the possibilities to get this activity not responding error.

Thanks,

Lakshmanan

A: 

You need to perform blocking operations such as I/O in a separate thread - see the below linked resource:

http://developer.android.com/guide/practices/design/responsiveness.html:

In Android, the system guards against applications that are insufficiently responsive for a period of time by displaying a dialog to the user, called the Application Not Responding (ANR) dialog, shown at right in Figure 1. The user can choose to let the application continue, but the user won't appreciate having to act on this dialog every time he or she uses your application. It's critical to design responsiveness into your application, so that the system never has cause to display an ANR dialog to the user.

fornwall