Skip to content Skip to sidebar Skip to footer

Activitymanager Process Has Died Issue

My app contains 5 screens. In the first screen, I load some data from the server and show those data in a listview in the second screen. In the listview I have to show an image for

Solution 1:

A lot of weird text in the beginning of the stack trace is native crash dump. Crash happens because of unhandled runtime error in one of the native libraries. The error happens because of accessing non-mapped address 0xdeadbaad:

08-25 10:44:31.635: INFO/DEBUG(16421): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad

After this error application process is terminated and relaunched. SecondScreenActivity is created and then its state is restored from the last saved state.

EDIT: I don't think the problem is in your code. Seems it's an Android bug. Here's a bug report: http://code.google.com/p/android/issues/detail?id=14498.

This report contains the following conclusion:

The APK is using Bitmaps from multiple threads, reusing it after it has been (or while it is being) recycled. The Skia graphics library is not completely thread-safe, and introducing additional synchronization is too expensive, so this won't be fixed in the platform.

So you need to be careful about what you recycle().

Solution 2:

Try This Code.

First Declare All Variables/Objects Globally.

Then Use Following Function For Download Image in SDCard.

First Disply this Image in ImageView call following function on Click Event of Download Button.

Bitmap bmpImage;
bmpImage = loadBitmapFromView(imgview1);
downloadImageinphone(bmpImage);



publicstatic Bitmap loadBitmapFromView(ImageView v) {
        Bitmapb= Bitmap.createBitmap(v.getWidth(), v.getHeight(),
                Bitmap.Config.ARGB_8888);
        Canvasc=newCanvas(b);
        // v.layout(0, 0, v.getWidth(), v.getHeight());
        v.draw(c);
        return b;
}

After Call this Function:-

Uri uri;
Bitmap b;

    privatevoiddownloadImageinphone(Bitmap b) {
        Stringfilename="tempImage";
        ContentValuesvalues=newContentValues();
        values.put(Images.Media.TITLE, filename);
        values.put(Images.Media.DATE_ADDED, System.currentTimeMillis());
        values.put(Images.Media.MIME_TYPE, "image/png");
        uri = getContentResolver().insert(Images.Media.EXTERNAL_CONTENT_URI,
                values);

        try {
            OutputStreamoutStream= getContentResolver().openOutputStream(uri);
            // outStream = new FileOutputStream(file);
            b.compress(Bitmap.CompressFormat.PNG, 100, outStream);
            outStream.flush();
            outStream.close();
            Log.d("done", "done");
            Toast.makeText(MainActivity.this,
                    "Photo is Successfully Downloaded",
                    Toast.LENGTH_LONG).show();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        b.recycle();
    }

Post a Comment for "Activitymanager Process Has Died Issue"