Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2009] Android: Cursor not showing up when clicked in Text fields

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-12-30T05:22:37.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterVinothbabu
AssigneeShak Hossain
Created2013-01-07T07:27:06.000+0000
Updated2016-03-08T07:40:57.000+0000

Description

When we set the following in AndroidManifest.xml, the cursor does not show up in TextFields:
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" />
It seems that when the targetSdkVersion is set to 16, the cursor is not showing up.

Comments

  1. Davide Cassenti 2013-03-13

    Hello, Can you provide a sample code, as well as some more information on the device you are testing with? I did try on my side, and the cursor seems to be working fine. Thank you
  2. Shak Hossain 2013-12-07

    Hi Vinoth, We have not heard back from you since you posted the issue. Not sure if this is still throwing error in your app. If so, please send us a test case so that we can take next necessary step to fix. If we don't hear back, we will assume the issue is no longer valid and close it. Thanks, Shak
  3. Mostafizur Rahman 2013-12-09

    We tested this issue with the test code below. We can’t reproduce this issue with Titanium SDK 3.1.3GA. Please test this issue using the latest release and let us know your feedback. If you continue to get the reported error, please post us your test case and steps to reproduce. We will revisit it again.

    Testing Environment:

    Ti CLI 3.1.2 Titanium SDK:3.0.2 and later Android SDK: 4.1 and later

    Steps to Reproduce:

    1.create a simple project. 2.Update this code in app.js and tiapp.xml 3.Then run this with testing environment. 4. Click on textfields 5. Cursor will shown well as we expected h5. Test Case app.js
       var win = Titanium.UI.createWindow({
       	layout : 'vertical',
       	title : 'TextField Test',
       	navBarHidden : false
       });
        
        
       var text1 = Ti.UI.createTextField({
       	height : Ti.UI.SIZE,
       	top : 10,
       	left : 10,
       	width : Ti.UI.FILL,
       	hintText : 'This is textField1',
       	keyboardType : Ti.UI.KEYBOARD_DEFAULT,
       	returnKeyType : Ti.UI.RETURNKEY_DEFAULT,
       	borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED
       });
        
        
       text1.addEventListener('return', function(e) {
       	text1.blur();
       	alert('Input was: ' + text1.value);
       });
        
        
       win.add(text1);
        
        
       var text2 = Ti.UI.createTextField({
       	height : Ti.UI.SIZE,
       	top : 10,
       	left : 10,
       	width : Ti.UI.FILL,
       	hintText : 'This is textField2',
       	keyboardType : Ti.UI.KEYBOARD_DEFAULT,
       	returnKeyType : Ti.UI.RETURNKEY_DEFAULT,
       	borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED
       });
        
       text2.addEventListener('return', function(e) {
       	text2.blur();
       	alert('Input was: ' + text2.value);
       });
        
       win.add(text2);
        
       var text3 = Ti.UI.createTextField({
       	height : Ti.UI.SIZE,
       	top : 10,
       	left : 10,
       	width : Ti.UI.FILL,
       	hintText : 'This is textField3',
       	keyboardType : Ti.UI.KEYBOARD_DEFAULT,
       	returnKeyType : Ti.UI.RETURNKEY_DEFAULT,
       	borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED
       });
        
       text3.addEventListener('return', function(e) {
       	text3.blur();
       	alert('Input was: ' + text3.value);
       });
        
       win.add(text3);
        
       win.open();
       
       
    tiapp.xml
       <android xmlns:android="http://schemas.android.com/apk/res/android">
               <tool-api-level>16</tool-api-level>
               <manifest>
                   <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16"/>
               </manifest>
           </android>
       
  4. Shak Hossain 2013-12-28

    This is not reproducible in the latest SDK. Posted a sample that works.
  5. Charles Tran 2013-12-31

    Please, reproduce this ticket on Ti SDK 3.2.0. It's not working for me.

    Environment:

    Titanium Studio, build: 3.2.0.201312191547 Titanium SDK version 3.2.0.GA CLI version 3.2.0 Aloy 1.3.0 Mac OSX: 10.9.1 Device: HTC One S, Android 4.1.1

    Step to Reproduce:

    1. Create a simple project 2. Open file ApplicationWindow.js for Android 3. Update code 4. Run app 5. Click on text field 6. Cursor not show up

    Test case:

    ApplicationWindow.js
       //Application Window Component Constructor
       function ApplicationWindow() {
       	//load component dependencies
       	var FirstView = require('ui/common/FirstView');
       
       	//create component instance
       	var self = Ti.UI.createWindow({
       		backgroundColor:'#ffffff',
       		navBarHidden:true,
       		exitOnClose:true
       	});
       
       	//construct UI
       	var firstView = new FirstView();
       	self.add(firstView);
       
       	
       	var txt = Ti.UI.createTextField({
       		top: 100,
       		left: 100,
       		width: 120,
       		height: 40,
       		color: 'red',
       		borderWidth: 1,
       		borderColor: 'blue'	
       	});
       	
       	firstView.add(txt);
       	
       	return self;
       }
       
       //make constructor function the public component interface
       module.exports = ApplicationWindow;
       
  6. Ritu Agrawal 2014-01-05

    [~tak8xx] We can reopen and investigate this ticket further if you can provide a simple and complete test case. You have provided a code snippet that refers to other code (ui/common/FirstView) so we can not use your code and we have not been able to reproduce using our own test.
  7. Charles Tran 2014-01-06

    @Ritu Agrawal, my complete test case. 1. Create new simple project 2. Put code in app.js
       var window = Ti.UI.createWindow({
       	backgroundColor:'#ffffff',
       	navBarHidden:true,
       	exitOnClose:true
       }),
       view = Ti.UI.createView(),
       textField = Ti.UI.createTextField({
           top: 100,
           left: 100,
           width: 120,
           height: 40,
           color: 'red',
           borderWidth: 1,
           borderColor: 'blue' 
       });
       
       view.add(textField);
       window.add(view);
       window.open();
       
       
  8. Ritu Agrawal 2014-01-06

    [~tak8xx] I tested your simple test on my Samsung Galaxy Nexus (4.2.2) device and I observed the same behavior irrespective of the targetSdkVersion I set in tiapp.xml file. An interesting behavior I observed is that the cursor did not show up in the portrait mode but it did show up in the landscape mode. Did you notice the different behavior in portrait and landscape modes as well?
  9. Charles Tran 2014-01-06

    @Ritu Agrawal, yes I see. The devices that I tested: - HTC One S, Android 4.1.1 => Working on landscape that not portrait mode - Samsung GT I9003, Android 2.3.5 => Working fine for me
  10. Ritu Agrawal 2014-01-06

    [~tak8xx] This issue appears to be a duplicate of TIMOB-13567 and related to default Holo theme. Can you please review the comments posted in TIMOB-13567 ticket and let me know if it resolves your issue?
  11. Charles Tran 2014-01-08

    Thank @Ritu Agrawal for support, I think if using custom theme as your suggestion is ok. But my project is not using Alloy, are there other solutions?
  12. Charles Tran 2014-01-08

    Oh sorry, still can apply custom theme into my project that not need to use Alloy. I applied successfully. Thanks again.

JSON Source