Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1124] Samsung Galaxy S4 Mini Crash when long pressing any label

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2015-07-21T21:14:17.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsLabel, Samsung, TCSupportTriage, android, longpress
ReporterMike Stancliffe
AssigneeRadamantis Torres-Lechuga
Created2014-11-12T19:28:18.000+0000
Updated2016-03-08T07:37:29.000+0000

Description

Long pressing on any label will cause app to crash on a Samsung Galaxy S4 Mini. I have included sample code that reproduces the issue as well as the console errors when it occurs below.
var win = Titanium.UI.createWindow({  
    title:'Window',
    backgroundColor:'#fff'
});

var label = Titanium.UI.createLabel({
	color:'#999',
	text:'Long Press to Crash Me',
	font:{fontSize:25,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});

win.add(label);
win.open();
{quote} [ERROR] : TiApplication: (main) [10813,10813] Sending event: exception on thread: main msg:java.lang.StringIndexOutOfBoundsException: length=22; regionStart=-1; regionLength=0; Titanium 3.4.1,2014/10/28 14:57,5172fc7 [ERROR] : TiApplication: java.lang.StringIndexOutOfBoundsException: length=22; regionStart=-1; regionLength=0 [ERROR] : TiApplication: at java.lang.String.startEndAndLength(String.java:588) [ERROR] : TiApplication: at java.lang.String.substring(String.java:1475) [ERROR] : TiApplication: at java.lang.String.subSequence(String.java:1862) [ERROR] : TiApplication: at android.widget.TextView.getTransformedText(TextView.java:10141) [ERROR] : TiApplication: at android.widget.Editor.performLongClick(Editor.java:1042) [ERROR] : TiApplication: at android.widget.TextView.performLongClick(TextView.java:10153) [ERROR] : TiApplication: at android.view.View$CheckForLongPress.run(View.java:19433) [ERROR] : TiApplication: at android.os.Handler.handleCallback(Handler.java:733) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:146) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5653) [ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:515) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) [ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method) {quote}

Comments

  1. Mauro Parra-Miranda 2014-11-12

    Hello [~cliff_stander]: Please provide the Mobile SDK version. Best Regards
  2. Mike Stancliffe 2014-11-12

    For sure it is present in 3.3.0, 3.4.0, 3.4.1RC I did not go back any further than that.
  3. Mike Stancliffe 2014-11-13

    I'll also add, that we have had no problems like this on at least a dozen other android devices, including other Samsung models with TouchWiz.
  4. Mike Stancliffe 2015-07-22

    Did you use an S4 Mini, I have tested this on multipule S4 minis and it is 100% reproduable.

JSON Source