android - Compound View and Restore State -
i have compound view has icon , edittext
:
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="@dimen/edit_text_height"> <imageview android:id="@+id/ivicon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="@dimen/edit_text_padding" android:layout_marginright="@dimen/edit_text_padding" android:layout_centervertical="true" /> <edittext android:id="@+id/etcontent" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centervertical="true" android:cursorvisible="true" android:gravity="left|center_vertical" android:layout_marginleft="@dimen/edit_text_padding" android:layout_marginright="@dimen/edit_text_padding" android:paddingleft="@dimen/edit_text_padding_left" android:paddingright="@dimen/edit_text_padding_left" android:layout_centerhorizontal="true" android:maxlines="1" android:background="@android:color/transparent" style="@style/edit_text" /> </relativelayout>
i'm using compound view in login form , other places in application. need save contents of fields whenever onsaveinstancestate()
occurs. when i'm restoring state, fields have same value of last edittext
fields, because, in general, edittext
views have same id (etcontent
).
besides that, if have login activity (email , password fields), generate security issue first field (email) have value of last field (in case password).
any suggestion fix issue?
Comments
Post a Comment