Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-17244

Android: When using border-related attributes in Search View, the app crashes

    Details

    • Type: Bug
    • Status: Open
    • Priority: None
    • Resolution: Unresolved
    • Affects Version/s: Release 3.3.0
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
    • Environment:

      Ti SDK 3.2.0 - possibly in 3.2.2/3.2.3
      Samsung Galaxy S3
      Android Sys version : 4.3

      Description

      Problem Description

      When using border-related attributes in Search View, the app crashes

      Testcase

      1. Create a new mobile project (classic titanium)
      2. Add this code to the app.js

      var win = Ti.UI.createWindow({});
      var searchingView = Ti.UI.Android.createSearchView({
      	borderColor : "#000000", //cause crash
      	borderRadius : 5, //cause crash
      	borderWidth : 1, //cause crash
      	backgroundColor : "#E5E4E2",
      	searchAsChild : true
      });
       
      var myTemplate = {
      	childTemplates : [{
      		type : 'Ti.UI.Label',
      		bindId : "title",
      		properties : {
      			width : Ti.UI.SIZE,
      			height : 44,
      			left : 10,
      			font : {
      				fontFamily : "Arial",
      				fontWeight : "normal",
      				fontSize : 14
      			},
      			color : "#6d6e76"
      		}
      	}]
      };
       
      var listView = Ti.UI.createListView({
      	top : 0,
      	templates : {
      		'template' : myTemplate
      	},
      	defaultItemTemplate : 'template',
      	separatorInsets : {
      		left : 0,
      		right : 0
      	},
      	backgroundColor : "#FFFFFF",
      	separatorColor : "#848482",
      	searchView : searchingView
      });
      var sections = [];
       
      var fruitSection = Ti.UI.createListSection();
      var fruitDataSet = [{
      	properties : {
      		"searchableText" : "Row One",
      	},
      	title : {
      		"text" : "Row One"
      	}
      }];
      fruitSection.setItems(fruitDataSet);
      sections.push(fruitSection);
       
      listView.setSections(sections);
       
      win.setBackgroundColor("e2e2e2");
       
      win.add(listView);
      win.open();
      

      Expected Result

      Set border properties for searchView

      Actual Result

      Crash the app

      Extra info

       TiApplication: (main) [152,890] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.negoapps.searchcrash/org.appcelerator.titanium.TiTranslucentActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.; Titanium 3.3.0,2014/05/24 22:42,baea217
      [ERROR] :  TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.negoapps.searchcrash/org.appcelerator.titanium.TiTranslucentActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
      [ERROR] : 
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jialhe85@gmail.com David He
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-18912
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration