tags:

views:

32

answers:

1

Hai Friends, I have created an sample application, in which i have a list view, when the user clicks the listview the next intent is called with no problem in sometimes, but most of the times it display Force Close or Wait Message as shown in the Image attached here, i want to stop displaying this Force Close or Wait Dialog, I have no idea how to stop this warning message, so guide me, to stop this. Pls refer my output alt text Pls refer my Logcat Message

10-28 16:30:54.640: DEBUG/NetworkLocationProvider(76): getLocation(): triggering a wifi scan
10-28 16:30:55.410: DEBUG/NetworkLocationProvider(76): updateWifIScanResults(): 5 APs
10-28 16:30:55.430: DEBUG/LocationMasfClient(76): getNetworkLocation(): Returning cache location with accuracy 75.0
10-28 16:31:05.220: DEBUG/dalvikvm(15032): GC freed 15 objects / 600 bytes in 124ms
10-28 16:31:05.690: INFO/ActivityManager(76): Stopping service: com.google.android.apps.maps/com.google.googlenav.friend.android.LocationFriendService
10-28 16:31:09.960: DEBUG/WifiService(76): ACTION_BATTERY_CHANGED pluggedType: 2
10-28 16:31:13.186: DEBUG/KeyguardViewMediator(76): wakeWhenReadyLocked(82)
10-28 16:31:13.190: DEBUG/KeyguardViewMediator(76): handleWakeWhenReady(82)
10-28 16:31:13.190: DEBUG/KeyguardViewMediator(76): pokeWakelock(5000)
10-28 16:31:13.250: DEBUG/WifiService(76): ACTION_SCREEN_ON
10-28 16:31:13.430: DEBUG/SurfaceFlinger(76): Screen about to return, flinger = 0x1896a0
10-28 16:31:15.610: DEBUG/KeyguardViewMediator(76): pokeWakelock(5000)

Thanks Tilsan The Fighter.

A: 

This message is shown when you block the GUI thread (your only thread if you didn't created others by hand) for a long time. If you have some code in your activity that does a lot of work or sleeps for a long time, you should move this code to another thread.

I would suggest measuring the time taken by all your activity methods.

Ruben
@Ruben:Thanks for ur Comments: You have suggested that measuring the time taken by all your activity methods, pls elaborate this, that is i am asking how to achieve this,pls show me some good samples.
Tilsan The Fighter
You can use the profiler, here you have a complete explanation that I have elaborated last month: http://organicandroid.blogspot.com/2010/09/performance.html
Ruben
Or if you prefer official developers word: http://android-developers.blogspot.com/2010/10/traceview-war-story.html
Ruben