ProgressDialog in Thread stopps when closing G1

by Stoyan Damov » Fri, 06 Mar 2009 16:30:53 GMT

Sponsored Links
 Search this forum for "Dialog Survival Over Configuration Change"


ProgressDialog in Thread stopps when closing G1

by Marco Nelissen » Sun, 08 Mar 2009 00:22:31 GMT

 You should do all of your UI (and a progress dialog certainly counts
as UI) in the main thread of your application.


Sponsored Links

Other Threads

1. MultiTouch Support

Hi at all,

I have one issues with multitouch features offers by the MotionEvent
class, this is my code:

    public boolean onTouchEvent(MotionEvent event) {

        if(event.getPointerCount() == 1){

                switch (event.getAction()) {

                        case MotionEvent.ACTION_DOWN:
                                finger_one_ID = event.getAction() &
                        finger_one_X = (int) event.getX(finger_one_ID);
                        finger_one_Y = (int) event.getY(finger_one_ID);

                        case MotionEvent.ACTION_UP:
                                finger_one_ID = NONE;

                        case  MotionEvent.ACTION_MOVE:

                        deltaX =  finger_one_X - (int) 
                        deltaY =  finger_one_Y - (int) 

                        deltaX = Math.abs(deltaX);
                        deltaY = Math.abs(deltaY);
                        distance = (float) ((Math.sqrt(Math.pow(deltaX,2) +
Math.pow(deltaY, 2))));

                        if(deltaX > 5.0f && deltaX < 80)
                                renderer.setYacc( (deltaX  / 50));

                        else if(deltaY  > 5.0f && deltaY < 80)
                                renderer.setXacc( (deltaY / 50));




                Log.d(TAG, "Single finger_one_Y:"+finger_one_X);
                        Log.d(TAG, "Single finger_one_Y:"+finger_one_Y);


        else if(event.getPointerCount() == 2){
                Log.d(TAG,"Doppio Tocco");
                switch (event.getAction()) {
                        case MotionEvent.ACTION_POINTER_DOWN:
                                finger_two_ID = MotionEvent.ACTION_POINTER_DOWN 
                                finger_two_X = (int) event.getX(finger_two_ID);
                                finger_two_Y = (int) event.getY(finger_two_ID);
                                multitouch_distance = (float) 
Math.sqrt(Math.pow(finger_one_X -
finger_two_X, 2) + Math.pow(finger_one_Y - finger_two_Y, 2));

                        case MotionEvent.ACTION_MOVE:
                                finger_one_X = (int) event.getX(finger_one_ID);
                                finger_one_Y = (int) event.getY(finger_one_ID);
                                finger_two_X = (int) event.getX(finger_two_ID);
                                finger_two_Y = (int) event.getY(finger_two_ID);
                                multitouch_distance_updated = (float)
Math.sqrt(Math.pow(finger_one_X - finger_two_X, 2) +
Math.pow(finger_one_Y - finger_two_Y, 2));


                Log.d(TAG, "Double finger_one_Y:"+finger_one_X);
                        Log.d(TAG, "Doppio finger_one_Y:"+finger_one_Y);
                        Log.d(TAG, "Doppio finger_two_Y:"+finger_two_X);
                        Log.d(TAG, "Doppio finger_two_Y:"+finger_two_Y);



The problem is that in multitouch branch of my code the X,Y of first
and second finger are the same, therefore the multitouch distance is
even zero!!
I am tried to develop an two fingers zoom...

Any suggestion will be appreciated.



2. Recommended way to update map overlay in background

I'm working on an application with a number of activities, including a
MapViewActivity. The map has markers drawn on it as overlays. The
marker data is retrieved by regularly polling a web server, which
returns a JSON document. The data can change from time to time, and
when it does the map must be updated promptly.

What's the recommended way to poll the web server in the background
and update the map? I considered using a service, but ran into
problems with accessing the map overlays variables. The other approach
which springs to mind is to user a TimerTask (maybe calling an
AsyncTask if necessary to avoid blocking the UI thread) from the

Another consideration is that it would be nice to continue polling
when in other activities within the same application. This way when
the user switches to the map activity, the map is already up to date.
This is not a hard requirement though.



3. populate ItemizedOverlay when AlertDialog is showing

4. Augmented Reality - AR

5. ADB server didn't ACK, cannot bind tcp...

6. How to differentiate when screen is rotated and when is activity is sent back ( pressing back key)

7. Get MediaScanner current status