Re: [android-developers] [OutOfMemoryError] How to release Drawable object from memory ?

2009-11-28 Thread nada fatma
The Light Of Truth







[align=left]What is life? Man's existence in this world and the creation of
this entire universe are not mere accidents or products of a fortuitous
nature. This universe, every single atom of it, manifests and leads us to
the realization of a Loving, Merciful and All-powerful Creator. Without a
Creator, nothing can exist. Every single soul knows that he is existing and
that his existence is dependent upon a Creator he knows for sure that he
cannot create himself. Therefore it is his duty to know his master, the
Creator.

Mankind: Man is a unique creature. God gave man the ability to govern over
all other creatures in this world. He is endowed with the faculty of reason
which sets him apart from all other animals. Together with this faculty to
discriminate and discern, man is given the freedom (free-will) to choose for
himself a way of life worthy of his position or to fall lower than the
lowest of all animals or creations. Man is born pure and sinless and is
given the choice to do righteous deeds or indulge in sins.

Divine Guidance: The Creator, out of His abundant Love and Mercy for mankind
has not left us in darkness to discover the right path by trial and error
alone. Coupled with our intellectual capability to reason, our Creator
bestowed upon us Divine Guidance that outlines the criterion for truth,
knowledge, as well as the reality of our existence in this world and the
Hereafter.

Revelations: From the beginning of mankind, our Creator sent Prophets to
convey His revelation and to invite human beings to the path of true peace
and obedience to the One True God. This is Islam. This message is conveyed
towards successive generations of man through the different prophets, all
inviting mankind to the same path. However all the earlier messages or
revelations from God were distorted by people of later generations.

As a result of this distortion, pure Revelation from our Creator was
adulterated and polluted with myths, superstitions, idol worship and
irrational philosophical ideologies. The religion of God in a sense was lost
in a plethora of religions. Human history is a testament of man's drift
between light and darkness, but God out of His abundant love for mankind has
not forsaken us.

Final Revelation: When mankind was in the depths of the Dark Ages, our
Creator sent His final Messenger, Prophet Muhammad (sallallahu ‘alaihi wa
sallam) to redeem humanity with the final revelation which represents the
ultimate and permanent source of guidance for the whole world.

Criteria For Truth: The following criteria can best serve as a gauge to find
out the authenticity of the last revelation (the Qur'aan) as the Word of
God:

Rational Teachings:
Since our Creator bestowed reason and intellect upon us, it is our duty to
use it to distinguish the truth from falsehood. True, undistorted revelation
from God must be rational and can be reasoned out by all unbiased minds.

Perfection:
Since our Creator is all perfect, His revelation must be perfect and
accurate, free from mistakes, omissions, interpolations and multiplicity of
versions. It should be free from contradictions in its narration.

No Myths or Superstitions:
True revelation is free from myths or superstitions that degrade the dignity
of our Creator or man himself.

Scientific:
Since our Creator is the Creator of all knowledge, true revelation is
scientific and can withstand the challenge of science at all times.

Factual Prophecy:
Our Creator is the Knower of the past, present and future. Thus His
prophecies in His revelation will be fulfilled as prophesied.

Inimitable By Man:
True revelation is infallible and cannot be imitated by man. God's true
revelation is a Living miracle, an open book challenging all mankind to see
and prove for themselves its authenticity or veracity[/align]





Hi my name is Nada


THERE IS NO GOD BUT ONE"


you don't know about ISLAM
if you want to know mail me on
nada-fa...@maktoob.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] [OutOfMemoryError] How to release Drawable object from memory ?

2009-11-26 Thread Syl
In my application, user can click on a button and then he can select a
picture from his gallery.
This image is then displayed.

However, when the user performs 3 or 4 times this operation, the
following exception is thrown, due to memory allocation problem :


11-26 18:31:34.119: ERROR/dalvikvm-heap(707): 6291456-byte external
allocation too large for this process.
11-26 18:31:34.119: ERROR/(707): VM won't let us allocate 6291456
bytes
11-26 18:31:34.119: DEBUG/skia(707): 
allocPixelRef failed
11-26 18:31:36.005: DEBUG/AndroidRuntime(707): Shutting down VM
11-26 18:31:36.005: WARN/dalvikvm(707): threadid=3: thread exiting
with uncaught exception (group=0x40013e28)
11-26 18:31:36.005: ERROR/AndroidRuntime(707): Uncaught handler:
thread main exiting due to uncaught exception
11-26 18:31:36.099: ERROR/AndroidRuntime(707):
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:304)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.graphics.drawable.Drawable.createFromStream(Drawable.java:635)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
com.altran.test.selectpicture.MainActivity.onActivityResult
(MainActivity.java:74)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.app.Activity.dispatchActivityResult(Activity.java:3415)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.app.ActivityThread.deliverResults(ActivityThread.java:2835)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.app.ActivityThread.handleSendResult(ActivityThread.java:2881)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.app.ActivityThread.access$2300(ActivityThread.java:112)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1608)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.os.Handler.dispatchMessage(Handler.java:88)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.os.Looper.loop(Looper.java:123)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.app.ActivityThread.main(ActivityThread.java:3742)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
java.lang.reflect.Method.invokeNative(Native Method)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
java.lang.reflect.Method.invoke(Method.java:515)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:739)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
dalvik.system.NativeStart.main(Native Method)



Here a sample of my code where problem is focused :

InputStream is = getContentResolver().openInputStream( currImageURI );
Drawable drawable = Drawable.createFromStream( is, "src" );
is.close();
m_imageView.setBackgroundDrawable( drawable );



Is it possible to force object (here the Drawable object) to be
released from memory ?

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en