I want to set the hint in spinner. Like in edit text, I am giving the hint, that is:
android:Hint="First Name"
So what should I do for Spinner like for state?
My state will dynamically fill from the database. If I give the hint in array index[0]
, then it will effect on zeroth position of that field.
How can I do it?
Code
public String[] getState()
{
try
{
Cursor cursor = dbUser.State();
if (cursor.getCount() >= 0)
{
array_state = new String[cursor.getCount()];
i = 0;
while (cursor.moveToNext())
{
array_state[i] = cursor.getString(1);
i++;
}
}
}
catch (Exception e)
{
// TODO: handle exception
}
return array_state;
}