0

I am planning to add an input field (just like an EditText) to my Card. I am using the GDK. At present I have created a layout as below

<TextView 
    android:id="@+id/txt1"
    android:text="Which task do you want?"
    android:textSize="20sp"
    android:layout_gravity="center_horizontal"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

<EditText 
    android:id="@+id/edit1"
    android:layout_gravity="center_horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint=""/>

However, the EditText is not the one I need since using glass we can't type.

So can anyone tell me how to add input fields to card?

Parth Doshi
  • 4,200
  • 15
  • 79
  • 129
  • How are you planning to get the user input? as you mentioned you can't type so any input field seems like it could be poor user experience. What is it you are trying to achieve? – Ben May 12 '14 at 08:28
  • I am trying to make an application such that if you speak any word it will recognize it and populate the input field. but right now i dont know to create a input field – Parth Doshi May 12 '14 at 09:20
  • I still don't get your question. –  May 12 '14 at 09:31
  • I'd just use a TextView and style it to look like an input field as you don't actually need any of the functionality of an input field. – Ben May 12 '14 at 12:03
  • Ben you are right. I did exactly the same. Post your answer and code and I will accept it since it helped me :) – Parth Doshi May 12 '14 at 16:51

1 Answers1

0

As mentioned in comments, there is no easy way to actually type into an input field so there is no need to use the features of an input, instead you can just style a TextView to look like an input field (typically with a border around it) and update the value from the back end as needed

((TextView)findViewById(R.id.my_text_view)).setText(myStringValue);
Ben
  • 1,767
  • 16
  • 32