{ "id": "134846", "key": "TIMOB-18177", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2015-04-21T18:15:30.000+0000", "created": "2014-08-17T20:28:27.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "TCSupportTriage" ], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" }, { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" }, { "id": "16676", "description": "Release 3.4.1", "name": "Release 3.4.1", "archived": false, "released": true, "releaseDate": "2014-11-14" } ], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-31T17:20:32.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h4. Problem Description\r\nOn Android searching with a SearchView attached to a listview that uses templates causes the app to crash.\r\n\r\nWorks fine on iOS and interestingly on Genymotion S5 emulator. But crashes on device. The error log is below.\r\n\r\nMaybe related to this forum post [https://developer.appcelerator.com/question/173280/search-alloy-collection-in-listview-using-template]\r\n\r\nh4. Test Case\r\n1. Create a new mobile project ( Classic Titanium ) \r\n2. Copy this code into app.js\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\r\n\r\nvar myTemplate = {\r\n childTemplates: [\r\n { \r\n type: 'Ti.UI.ImageView', \r\n bindId: 'pic', \r\n properties: { \r\n width: '50dp', height: '50dp', left: 0\r\n }\r\n },\r\n { \r\n type: 'Ti.UI.Label', \r\n bindId: 'info', \r\n properties: { \r\n color: 'black',\r\n font: { fontFamily:'Arial', fontSize: '20dp', fontWeight:'bold' },\r\n left: '60dp', top: 0,\r\n }\r\n },\r\n { \r\n type: 'Ti.UI.Label', \r\n bindId: 'es_info', \r\n properties: { \r\n color: 'gray',\r\n font: { fontFamily:'Arial', fontSize: '14dp' },\r\n left: '60dp', top: '25dp',\r\n }\r\n }\r\n ]\r\n};\r\n\r\nsearch = Ti.UI.Android.createSearchView({\r\n hintText: \"Table Search\"\r\n });\r\n \r\nvar listView = Ti.UI.createListView({\r\n templates: { 'template': myTemplate },\r\n defaultItemTemplate: 'template',\r\n searchView:search\r\n});\r\nvar sections = [];\r\n\r\nvar fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits / Frutas'});\r\nvar fruitDataSet = [\r\n { info: {text: 'Apple'}, es_info: {text: 'Manzana'}, pic: {image: 'apple.png'}},\r\n { info: {text: 'Banana'}, es_info: {text: 'Banana'}, pic: {image: 'banana.png'}}\r\n];\r\nfruitSection.setItems(fruitDataSet);\r\nsections.push(fruitSection);\r\n\r\nvar vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables / Verduras'});\r\nvar vegDataSet = [\r\n { info: {text: 'Carrot'}, es_info: {text: 'Zanahoria'}, pic: {image: 'carrot.png'}},\r\n { info: {text: 'Potato'}, es_info: {text: 'Patata'}, pic: {image: 'potato.png'}}\r\n];\r\nvegSection.setItems(vegDataSet);\r\nsections.push(vegSection);\r\n\r\nvar grainSection = Ti.UI.createListSection({ headerTitle: 'Grains / Granos'});\r\nvar grainDataSet = [\r\n { info: {text: 'Corn'}, es_info: {text: 'Maiz'}, pic: {image: 'corn.png'}},\r\n { info: {text: 'Rice'}, es_info: {text: 'Arroz'}, pic: {image: 'rice.png'}}\r\n];\r\ngrainSection.setItems(grainDataSet);\r\nsections.push(grainSection);\r\n\r\nlistView.setSections(sections);\r\nwin.add(listView);\r\nwin.open();\r\n{code}\r\n3. Run it on a device\r\n4. Click on the search \r\n\r\nh4. Actual Results\r\nThe app will crash\r\n\r\nh4. Expected results \r\nThe app working fine. \r\n\r\n\r\nh4. Extra info \r\n{panel:title=Error log}\r\n[ERROR] TiApplication: (main) [2475,185914] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.3.0,2014/07/11 12:36,787cd39\r\n[ERROR] TiApplication: java.lang.NullPointerException\r\n[ERROR] TiApplication: \tat ti.modules.titanium.ui.widget.listview.ListSectionProxy.applyFilter(ListSectionProxy.java:935)\r\n[ERROR] TiApplication: \tat ti.modules.titanium.ui.widget.listview.TiListView.reFilter(TiListView.java:543)\r\n[ERROR] TiApplication: \tat ti.modules.titanium.ui.widget.listview.TiListView.filterBy(TiListView.java:851)\r\n[ERROR] TiApplication: \tat ti.modules.titanium.ui.widget.searchview.TiUISearchView.onQueryTextChange(TiUISearchView.java:90)\r\n[ERROR] TiApplication: \tat android.support.v7.widget.SearchView.onTextChanged(SearchView.java:1118)\r\n[ERROR] TiApplication: \tat android.support.v7.widget.SearchView.access$2000(SearchView.java:103)\r\n[ERROR] TiApplication: \tat android.support.v7.widget.SearchView$12.onTextChanged(SearchView.java:1578)\r\n[ERROR] TiApplication: \tat android.widget.TextView.sendOnTextChanged(TextView.java:8905)\r\n[ERROR] TiApplication: \tat android.widget.TextView.handleTextChanged(TextView.java:8979)\r\n[ERROR] TiApplication: \tat android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:11160)\r\n[ERROR] TiApplication: \tat android.text.SpannableStringBuilder.sendTextChanged(SpannableStringBuilder.java:964)\r\n[ERROR] TiApplication: \tat android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:498)\r\n[ERROR] TiApplication: \tat android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:437)\r\n[ERROR] TiApplication: \tat android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:30)\r\n[ERROR] TiApplication: \tat android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:679)\r\n[ERROR] TiApplication: \tat android.view.inputmethod.BaseInputConnection.setComposingText(BaseInputConnection.java:437)\r\n[ERROR] TiApplication: \tat com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:333)\r\n[ERROR] TiApplication: \tat com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:77)\r\n[ERROR] TiApplication: \tat android.os.Handler.dispatchMessage(Handler.java:102)\r\n[ERROR] TiApplication: \tat android.os.Looper.loop(Looper.java:136)\r\n[ERROR] TiApplication: \tat android.app.ActivityThread.main(ActivityThread.java:5579)\r\n[ERROR] TiApplication: \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n[ERROR] TiApplication: \tat java.lang.reflect.Method.invoke(Method.java:515)\r\n[ERROR] TiApplication: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)\r\n[ERROR] TiApplication: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)\r\n[ERROR] TiApplication: \tat dalvik.system.NativeStart.main(Native Method)\r\n{panel}", "attachment": [], "flagged": false, "summary": "Android: Search on listview crashes app", "creator": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "environment": "OSX 10.9 SDK 3.3.0.GA Android 4.4 on Samsung device S5\r\nMobile SDK 3.4.1", "closedSprints": [ { "id": 371, "state": "closed", "name": "2015 Sprint 08 SDK", "startDate": "2015-04-11T00:00:49.626Z", "endDate": "2015-04-24T12:00:00.000Z", "completeDate": "2015-04-28T15:02:06.073Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "416499", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as I am unable to reproduce the issue using the following environment; \r\nPixel (7.1) \r\nMacOS 10.11.6 (15G31) \r\nStudio 4.8.1.201612050850 \r\nTi SDK 6.0.3 GA \r\nAppc NPM 4.2.8 \r\nAppc CLI 6.1.0 \r\nTi CLI 5.0.11 \r\nAlloy 1.9.5 \r\nArrow 1.10.1 \r\nXcode 8.2 (8C38) \r\nNode v4.6.0 \r\nJava 1.7.0_80", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-31T17:20:32.000+0000", "updated": "2017-03-31T17:20:32.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }