read only field

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

read only field

Postby nisha » Thu May 08, 2008 5:56 am

Hi All,


I want to make a field read only... Say in date field "10/10/2008" ... i want " / / " to be made read only... So that user has to edit only date and not slash.. i.e / ...
Waiting for reply..

regards and thanks,
nisha
nisha
Experienced Developer
Experienced Developer
 
Posts: 80
Joined: Fri Feb 15, 2008 7:52 am

Top

Postby plusminus » Fri May 16, 2008 11:03 am

Hello nisha,

there is the [font=Lucida Console]android.text.method.DateInputMethod[/font] for entering dates in a text field. I haven't tried it, but maybe it is what you need.

Use it like this:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                 EditText e = new EditText(this);
  2.  
  3.                 e.setInputMethod(new DateInputMethod());
Parsed in 0.072 seconds, using GeSHi 1.0.8.4

(This can also be done via XML)

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby nisha » Mon May 19, 2008 10:13 am

Hi,

Thanks... Its working.. However i wanted " / / " to be read only... I mean whenever user is entering the date he need not edit " / / " again in date... setText can be done but when user will do backspace those slashes " / / " will be deleted... Waiting for your reply...


thanks and regards,
nisha
nisha
Experienced Developer
Experienced Developer
 
Posts: 80
Joined: Fri Feb 15, 2008 7:52 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 3 guests