{"action":"created","issue":{"url":"https://api.github.com/repos/koral--/android-gif-drawable/issues/111","labels_url":"https://api.github.com/repos/koral--/android-gif-drawable/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/koral--/android-gif-drawable/issues/111/comments","events_url":"https://api.github.com/repos/koral--/android-gif-drawable/issues/111/events","html_url":"https://github.com/koral--/android-gif-drawable/issues/111","id":54028835,"number":111,"title":"Add GifImageView in listview cause out of memory","user":{"login":"lzou","id":2950642,"avatar_url":"https://avatars.githubusercontent.com/u/2950642?v=3","gravatar_id":"","url":"https://api.github.com/users/lzou","html_url":"https://github.com/lzou","followers_url":"https://api.github.com/users/lzou/followers","following_url":"https://api.github.com/users/lzou/following{/other_user}","gists_url":"https://api.github.com/users/lzou/gists{/gist_id}","starred_url":"https://api.github.com/users/lzou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzou/subscriptions","organizations_url":"https://api.github.com/users/lzou/orgs","repos_url":"https://api.github.com/users/lzou/repos","events_url":"https://api.github.com/users/lzou/events{/privacy}","received_events_url":"https://api.github.com/users/lzou/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/koral--/android-gif-drawable/labels/question","name":"question","color":"c7def8"}],"state":"closed","locked":false,"assignee":{"login":"koral--","id":3340954,"avatar_url":"https://avatars.githubusercontent.com/u/3340954?v=3","gravatar_id":"","url":"https://api.github.com/users/koral--","html_url":"https://github.com/koral--","followers_url":"https://api.github.com/users/koral--/followers","following_url":"https://api.github.com/users/koral--/following{/other_user}","gists_url":"https://api.github.com/users/koral--/gists{/gist_id}","starred_url":"https://api.github.com/users/koral--/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koral--/subscriptions","organizations_url":"https://api.github.com/users/koral--/orgs","repos_url":"https://api.github.com/users/koral--/repos","events_url":"https://api.github.com/users/koral--/events{/privacy}","received_events_url":"https://api.github.com/users/koral--/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-01-12T08:11:01Z","updated_at":"2015-01-17T14:49:07Z","closed_at":"2015-01-15T03:03:19Z","body":"source code:\r\ngifImage.setImageResource(id);\r\n\r\nid is a gif picture in drawable folder.\r\nI slide up and down the listview.then if will outofmemery.\r\nJava.lang.OutOfMemoryError\r\n\r\nhow can i avoid it? thanks"},"comment":{"url":"https://api.github.com/repos/koral--/android-gif-drawable/issues/comments/70369581","html_url":"https://github.com/koral--/android-gif-drawable/issues/111#issuecomment-70369581","issue_url":"https://api.github.com/repos/koral--/android-gif-drawable/issues/111","id":70369581,"user":{"login":"koral--","id":3340954,"avatar_url":"https://avatars.githubusercontent.com/u/3340954?v=3","gravatar_id":"","url":"https://api.github.com/users/koral--","html_url":"https://github.com/koral--","followers_url":"https://api.github.com/users/koral--/followers","following_url":"https://api.github.com/users/koral--/following{/other_user}","gists_url":"https://api.github.com/users/koral--/gists{/gist_id}","starred_url":"https://api.github.com/users/koral--/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koral--/subscriptions","organizations_url":"https://api.github.com/users/koral--/orgs","repos_url":"https://api.github.com/users/koral--/repos","events_url":"https://api.github.com/users/koral--/events{/privacy}","received_events_url":"https://api.github.com/users/koral--/received_events","type":"User","site_admin":false},"created_at":"2015-01-17T14:49:07Z","updated_at":"2015-01-17T14:49:07Z","body":"Just set background below given code, eg:\r\n```java\r\n@Override\r\n        public View getView(int position, View convertView, ViewGroup parent) {\r\n//code to inflate view if needed here\r\n            GifImageView gifImageView = (GifImageView) convertView.findViewById(R.id.giv);\r\n            Drawable d = gifImageView.getBackground();\r\n            if (d instanceof GifDrawable) {\r\n                ((GifDrawable) d).recycle();\r\n            }\r\ngifImageView.setBackground(new GifDrawable(...));\r\n//rest of the getView code here\r\n```"}}