{"action":"created","issue":{"url":"https://api.github.com/repos/baoyongzhang/SwipeMenuListView/issues/26","labels_url":"https://api.github.com/repos/baoyongzhang/SwipeMenuListView/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/baoyongzhang/SwipeMenuListView/issues/26/comments","events_url":"https://api.github.com/repos/baoyongzhang/SwipeMenuListView/issues/26/events","html_url":"https://github.com/baoyongzhang/SwipeMenuListView/issues/26","id":61448182,"number":26,"title":"Invalid position returned in ArrayAdapter","user":{"login":"Fedor-Tsyganov","id":5728660,"avatar_url":"https://avatars.githubusercontent.com/u/5728660?v=3","gravatar_id":"","url":"https://api.github.com/users/Fedor-Tsyganov","html_url":"https://github.com/Fedor-Tsyganov","followers_url":"https://api.github.com/users/Fedor-Tsyganov/followers","following_url":"https://api.github.com/users/Fedor-Tsyganov/following{/other_user}","gists_url":"https://api.github.com/users/Fedor-Tsyganov/gists{/gist_id}","starred_url":"https://api.github.com/users/Fedor-Tsyganov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fedor-Tsyganov/subscriptions","organizations_url":"https://api.github.com/users/Fedor-Tsyganov/orgs","repos_url":"https://api.github.com/users/Fedor-Tsyganov/repos","events_url":"https://api.github.com/users/Fedor-Tsyganov/events{/privacy}","received_events_url":"https://api.github.com/users/Fedor-Tsyganov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-14T06:10:20Z","updated_at":"2015-03-14T06:30:18Z","closed_at":null,"body":"Tested versus regular ListView and correct position was returned, but SwipeMenuListView returns invalid position.\r\n\r\nI have an array of 38 objects and using simple getView(int position, View convertView, ViewGroup parent) method to return a custom view.\r\n\r\nHere's log file to show how it works with SwipeMenuListView and regular ListView\r\n\r\nSwipeMenuListView - Invalid position example:\r\n03-14 01:29:43.717    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0\r\n03-14 01:29:43.718    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1\r\n03-14 01:29:43.718    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2\r\n03-14 01:29:43.719    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3\r\n03-14 01:29:43.720    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4\r\n03-14 01:29:43.721    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 5\r\n03-14 01:29:43.721    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 6\r\n03-14 01:29:43.721    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 7\r\n03-14 01:29:43.722    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0\r\n03-14 01:29:43.722    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1\r\n03-14 01:29:43.723    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2\r\n03-14 01:29:43.724    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3\r\n03-14 01:29:43.725    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4\r\n03-14 01:29:43.726    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 5\r\n03-14 01:29:43.726    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 6\r\n03-14 01:29:43.727    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 7\r\n03-14 01:29:43.727    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0\r\n03-14 01:29:43.728    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1\r\n03-14 01:29:43.728    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2\r\n03-14 01:29:43.729    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3\r\n03-14 01:29:43.729    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4\r\n03-14 01:29:43.731    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 5\r\n03-14 01:29:43.731    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 6\r\n03-14 01:29:43.731    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 7\r\n03-14 01:29:43.732    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0\r\n03-14 01:29:43.732    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1\r\n03-14 01:29:43.733    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2\r\n03-14 01:29:43.733    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3\r\n03-14 01:29:43.734    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4\r\n03-14 01:29:43.734    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 5\r\n03-14 01:29:43.735    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 6\r\n03-14 01:29:43.735    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 7\r\n03-14 01:29:43.736    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0\r\n03-14 01:29:43.737    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1\r\n03-14 01:29:43.738    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2\r\n03-14 01:29:43.739    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3\r\n03-14 01:29:43.740    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4\r\n03-14 01:29:43.740    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 5\r\n03-14 01:29:43.741    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 6\r\n03-14 01:29:43.742    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 7\r\n03-14 01:29:43.748    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0\r\n03-14 01:29:43.748    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1\r\n03-14 01:29:43.749    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2\r\n03-14 01:29:43.749    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3\r\n03-14 01:29:43.749    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4\r\n03-14 01:29:43.750    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0\r\n03-14 01:29:43.750    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1\r\n03-14 01:29:43.750    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2\r\n03-14 01:29:43.750    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3\r\n03-14 01:29:43.751    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0\r\n03-14 01:29:43.751    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1\r\n03-14 01:29:43.751    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2\r\n03-14 01:29:43.752    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3\r\n03-14 01:29:43.752    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 4\r\n03-14 01:29:43.752    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 0\r\n03-14 01:29:43.752    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 1\r\n03-14 01:29:43.753    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 2\r\n03-14 01:29:43.753    3052-3052/com.fedortsyganov.iptest I/Position﹕ -> 3\r\n\r\n\r\nListView - valid position example:\r\n03-14 02:06:58.644    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 4\r\n03-14 02:06:58.660    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 5\r\n03-14 02:06:58.678    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 6\r\n03-14 02:06:58.694    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 7\r\n03-14 02:06:58.694    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 8\r\n03-14 02:06:58.710    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 9\r\n03-14 02:06:58.731    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 10\r\n03-14 02:06:58.732    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 11\r\n03-14 02:06:58.743    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 12\r\n03-14 02:06:58.762    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 13\r\n03-14 02:06:58.777    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 14\r\n03-14 02:06:58.778    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 15\r\n03-14 02:06:58.794    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 16\r\n03-14 02:06:58.811    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 17\r\n03-14 02:06:58.828    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 18\r\n03-14 02:06:58.846    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 19\r\n03-14 02:06:58.846    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 20\r\n03-14 02:06:58.863    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 21\r\n03-14 02:06:58.877    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 22\r\n03-14 02:06:58.894    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 23\r\n03-14 02:06:58.912    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 24\r\n03-14 02:06:58.927    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 25\r\n03-14 02:06:58.929    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 26\r\n03-14 02:06:58.944    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 27\r\n03-14 02:06:58.961    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 28\r\n03-14 02:06:58.977    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 29\r\n03-14 02:06:58.994    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 30\r\n03-14 02:06:59.012    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 31\r\n03-14 02:06:59.028    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 32\r\n03-14 02:06:59.045    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 33\r\n03-14 02:06:59.061    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 34\r\n03-14 02:06:59.077    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 35\r\n03-14 02:06:59.094    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 36\r\n03-14 02:06:59.110    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 37\r\n03-14 02:06:59.128    4842-4842/com.fedortsyganov.iptest I/Position﹕ -> 30"},"comment":{"url":"https://api.github.com/repos/baoyongzhang/SwipeMenuListView/issues/comments/79997928","html_url":"https://github.com/baoyongzhang/SwipeMenuListView/issues/26#issuecomment-79997928","issue_url":"https://api.github.com/repos/baoyongzhang/SwipeMenuListView/issues/26","id":79997928,"user":{"login":"Fedor-Tsyganov","id":5728660,"avatar_url":"https://avatars.githubusercontent.com/u/5728660?v=3","gravatar_id":"","url":"https://api.github.com/users/Fedor-Tsyganov","html_url":"https://github.com/Fedor-Tsyganov","followers_url":"https://api.github.com/users/Fedor-Tsyganov/followers","following_url":"https://api.github.com/users/Fedor-Tsyganov/following{/other_user}","gists_url":"https://api.github.com/users/Fedor-Tsyganov/gists{/gist_id}","starred_url":"https://api.github.com/users/Fedor-Tsyganov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fedor-Tsyganov/subscriptions","organizations_url":"https://api.github.com/users/Fedor-Tsyganov/orgs","repos_url":"https://api.github.com/users/Fedor-Tsyganov/repos","events_url":"https://api.github.com/users/Fedor-Tsyganov/events{/privacy}","received_events_url":"https://api.github.com/users/Fedor-Tsyganov/received_events","type":"User","site_admin":false},"created_at":"2015-03-14T06:30:17Z","updated_at":"2015-03-14T06:30:17Z","body":"Ok, I figured out what caused this problem.\r\nIn SwipeMenuAdapter.java under getView() method you need explicitly inflate view, thus removing \r\nthis line:\r\n    if (convertView == null)\r\n\r\nand then remove this block:\r\n\r\nelse\r\n        {\r\n            layout = (SwipeMenuLayout) convertView;\r\n            layout.closeMenu();\r\n            layout.setPosition(position);\r\n            View view = mAdapter.getView(position, layout.getContentView(), parent);\r\n        }"}}