0

this is a bug I thing , I've a form , the first element is an edittext , It has a hint text .

on android 4 it's ok but on android 2.3 , when the activity runs , the hint text is gone because edittext got the focus .

so , the text is hide and users don't know what is this edittext

is there anyway to solve this ?

thanks

mohsen
  • 451
  • 2
  • 6
  • 15

3 Answers3

1

you can add a focusable linearlayout as mentioned here. Add this linearlayout as first view in root layout of your form's layout xml.

<LinearLayout
    android:focusable="true" android:focusableInTouchMode="true"
    android:layout_width="0px" android:layout_height="0px"/>

This will stop Edittext getting the focus on activity launch and so user can click to open keyboard on that after reading the hint.

Community
  • 1
  • 1
Rajen Raiyarela
  • 5,526
  • 4
  • 21
  • 41
1

programatically

edttextid.setFocusableInTouchMode(true);
edttextid.setFocusable(true);

through Layout XMl

android:Focusable="true"
android:FocusInTouchMode="true"

Hope it may help you

Spry Techies
  • 896
  • 6
  • 21
0

after lots of searches ,I found the problem .

the problem is from edittext and you should add android:ellipsize="start" to edittext in xml , it solves my problem

mohsen
  • 451
  • 2
  • 6
  • 15
  • Not sure, if that is the right solution though, ellipsize property is for cases where the text is longer than the width of the view and you'd like to truncate the text (start, middle, end). Just my two cents. – Gaurav Arora Oct 02 '14 at 12:44