Force Close while selecting images form image gallary
<p>in my program i am trying to select image from image gallary. The problem is while trying to select new imgaes continiously for two to three times i am getting "bitmap size exceeds VM budget" exception</p>

<p>this is my code onActivity result</p>

<pre><code>    public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == RESULT_OK) {
        switch (requestCode) {
        case SELECT_IMAGE:
            String imagePath = getPath(data.getData());
            Savingimagepath(imagePath);
            img.setImageDrawable(Drawable.createFromPath(imagePath));
            break;
        }
    }
}
</code></pre>

<p>Any one pls help to over come this problem...</p>

<p>This is my log cat...</p>

<pre><code>02-16 12:16:57.870: W/dalvikvm(2198): threadid=1: thread exiting with uncaught exception (group=0x40015560)
02-16 12:16:57.870: E/AndroidRuntime(2198): FATAL EXCEPTION: main
02-16 12:16:57.870: E/AndroidRuntime(2198): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
02-16 12:16:57.870: E/AndroidRuntime(2198):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:470)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:284)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:309)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at android.graphics.drawable.Drawable.createFromPath(Drawable.java:800)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at palmagent.FidelityAgent.CA.contact.onActivityResult(contact.java:249)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at android.app.Activity.dispatchActivityResult(Activity.java:3908)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at android.app.ActivityThread.deliverResults(ActivityThread.java:2528)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:2574)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at android.app.ActivityThread.access$2000(ActivityThread.java:117)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:961)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at android.os.Looper.loop(Looper.java:130)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at android.app.ActivityThread.main(ActivityThread.java:3683)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at java.lang.reflect.Method.invokeNative(Native Method)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at java.lang.reflect.Method.invoke(Method.java:507)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-16 12:16:57.870: E/AndroidRuntime(2198):     at dalvik.system.NativeStart.main(Native Method)
</code></pre>
