java.lang.OutOfMemoryError in my android application -


I have 18 images that make a flower while overlapping each and every app in the form of a stack. XML files are added to the activity in the Android: src: '@ drawable / blabla ..' ... but when I run my application, it returns an error java.lang. OutOfMemoryError Please help me ... I know that I have this problem. Thank you ...

  Public class PapatyaFaliActivity extends activity {no G integer [] startLeafID = {R can solve .id.imag, R.id.birstart, R.id.ikistart, R.id.ucstart, R.id.dortstart, R.id.besstart, R. Id.altistart, R.id.yedistart, R.id.sekizstart, R.id.dokuzstart, R.id.onstart, R.id.onbirstart, R.id.onikistart, R.id.onucstart, R.id. Ondortstart, R.id.onbesstart, R.id.onaltistart}; Private imagev [] paperstraft = new imageview [17]; Private integer [] leafResouseID = {R.drawable.papatya_orta, R.drawable.leaf_1, R.drawable.leaf_2, R.drawable.leaf_3, R.drawable.leaf_4, R.drawable.leaf_5, R.drawable.leaf_6, R. .drawable.leaf_7, R.drawable.leaf_8, R.drawable.leaf_9, R.drawable.leaf_10, R.drawable.leaf_11, R.drawable.leaf_12, R.drawable.leaf_13, R.drawable.leaf_14, R.drawable .leaf_15, R.drawable.leaf_16}; Override public null on @reate (bundle saved instainstate) {super.naught (savedinstenstate); SetContentView (R.layout.main); For (Int i = 0; I    

Keep bitmaps Try reading your 18 bitmap from within your code Res / drawable-hdpi folder. (different image qualities for individual folders) to set up bitmap field in your code:

  bitmap alpha; bitmap Fu;   

now bitmap initialize the onResume () Do:

  option option = new option (); Alpha = Bitmapfirnet. Decode processing (Gemkjetsisosors (), Ardroupybl. Ubitmapanam, options); Foo = Bitmapfirnet. Decode processing (GamekgetResources (), RkdrawablekyouBitmapName2, options);  < / pre> 

option enables you to Daunsampl. (I could be sure how big I'm not your picture, but you also want to use scaling methods)

OnPause, by calling the resources clear:.

  alpha.recycle (); Alpha = null; Foo.recycle (); Foo = null;   

As soon called Risum () method, bitmaps will resume.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -