0

With a simple bit of Android XML:

<EditText
    android:id="@+id/editText"
    android:layout_width="100dp"
    android:layout_height="wrap_content"
    android:layout_marginLeft="20dp"
    android:layout_marginRight="20dp" >
</EditText>

Is there any way that you can add an additional String or Integer variable to the edit text field, such as an Integer called Section ID which can be set and called in the Java code. I am not talking about changing the "@+id" variable as there may be multiple Views with this variable. If so how could this be created/edited/called from within the java code itself.

1
  • You can always create your own edittext class and add your personal parameters! Commented Aug 19, 2013 at 9:55

1 Answer 1

3

Use setTag() and getTag() for this purpose

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.