ActivityManager.restartPackage() and syncing - Sync on StatusBar remains after killing

by Dianne Hackborn » Sat, 03 Oct 2009 00:47:14 GMT


Sponsored Links
 You'll probably need to reboot your device.  You could try toggling the sync
checkbox to make it restart a sync, but this may not complete fix things.
 Force stopping built-in applications is playing with fire. :)  (Fwiw,
possibly you force stopped the apk in gapps that managers the connection to
the google services, so you no longer are getting tickles to cause updates
and other things related to your account.)






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Problem with SurfaceView

Hi, I am working in an Android application, now I am trying to migrate
it to version 0.9, but I am having some problems. I would like to use
the same SurfaceView to put videos and images.

In first place I would like to know how can I use a SurfaceView to
display bitmaps and videos. For example, I would like to put an image
of loading while I download the video, and when it is ready play it.
The problem is that when I use
myHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS), I can use
lockCanvas, so I can put any image even when I set another type.

(This used to work in m5)

Here is what I am using:

1. To set the bitmap in the SurfaceHolder:

        public static void setState(SurfaceHolder mHolder, SurfaceView
mPreview, Bitmap bitmap){
                try{
                    /*Center the image*/
                        double wP = mPreview.getWidth();
                        double hP = mPreview.getHeight();
                        double wB = bitmap.getWidth();
                        double hB = bitmap.getHeight();
                        double menos=1;
                        double i = 1;
                        double j = 1;

                        if (wP < wB)
                                i = wP/wB;
                        if (hP < hB)
                                j= hP/hB;

                        menos = Math.min(i,j);

                        int wTotal = (int)(wB*menos);
                        int hTotal = (int)(hB*menos);
                        int left = (int)((wP-wTotal)/2);
                        int top = (int)((hP-hTotal)/2);

                        Canvas canvas = mHolder.lockCanvas();
                        canvas.drawColor(Color.BLACK);
                        canvas.drawBitmap(bitmap, null, new 
Rect(left,top,wTotal+left,hTotal
+top), null);
                        mHolder.unlockCanvasAndPost(canvas);
                }catch(NullPointerException e){
                        Log.e("","NullPointerException in setState: ",e);
                }
        }

2. the SurfaceHolder and SurfacePreview

                mPreview
=(SurfaceView)player.findViewById(R.id.picture);
                mHolder = mPreview.getHolder();
                mHolder.addCallback(this);
                mHolder.setFixedSize(mPreview.getWidth(), mPreview.getHeight());
                //mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

3. The mediaPlayer

                        mediaPlayer = new MediaPlayer();
                        mediaPlayer.setAudioStreamType(2);
                        mediaPlayer.setDisplay(mHolder);
                        
//mediaPlayer.setDisplay(mPreview.getHolder().getSurface());

And another quick question, how can I change the size of the display
video to the size of the SurfaceView?.

Thanks so much and I hope someone can help me.

--~--~---------~--~----~------------~-------~--~----~

2. Feature Suggestion: Maps caching

Could you log this as a feature request in Android Issue Tracker...Thanks!

2008/8/24 Nils <[EMAIL PROTECTED]>


--~--~---------~--~----~------------~-------~--~----~

3. Keytool apparently not signing apk - What am I missing here?

4. MapView on load

5. java.net.SocketException: unknown error

6. DateUtils.getRelativeTimeSpanString in v0.9

7. Gallery missing attribute / method