1

I am developing an application that requires to post image to twitter, when I upload an image it shows out of memory error. When I try a second time it is posted successfully.

 Bitmap bitmap=Bitmap Factory.decode File(path);
Calaom
  • 244
  • 8
  • 25
vinod kumar
  • 59
  • 1
  • 12
  • 1
    Check out : http://developer.android.com/training/displaying-bitmaps/load-bitmap.html – Haresh Chhelana May 28 '15 at 13:40
  • i don't want to crop it. – vinod kumar May 28 '15 at 13:42
  • @vinodkumar if twitter does not give you any option to do a stream upload then you have no option but to scale it down. OOM happens when the image put into memory is bigger than the heap size of your device – tyczj May 28 '15 at 13:46
  • if you are going to post it, you don't need to load it as bitmap. If you are going to display it, follow the link given by @HareshChhelana. – njzk2 May 28 '15 at 13:51

1 Answers1

2

Out of memory error occurs when bitmap is large. Read this and this. Also check this. And sometimes largeheap=true in manifest also solves this problem.

Community
  • 1
  • 1
Nouman Ghaffar
  • 3,780
  • 1
  • 29
  • 37