Java Code Examples for android.widget.AdapterView#equals()

The following examples show how to use android.widget.AdapterView#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HistoryAPIActivity.java    From styT with Apache License 2.0 5 votes vote down vote up
public void onItemSelected(AdapterView<?> parent, View view, int position,
                           long id) {
    if (parent.equals(spMonth)) {
        spDay.setAdapter(new ArrayAdapter<String>(this, R.layout.view_spinner, getDays(position + 1)));
        spDay.setSelection(Integer.parseInt(currentDay) - 1);
    } else if (parent.equals(spDay)) {
        currentDay = Integer.toString(position + 1);
        String date = "" + spMonth.getSelectedItem() + spDay.getSelectedItem();
        api.queryHistory(date, this);
    }
}
 
Example 2
Source File: HistoryAPIActivity.java    From stynico with MIT License 5 votes vote down vote up
public void onItemSelected(AdapterView<?> parent, View view, int position,
		       long id)
   {
if (parent.equals(spMonth))
{
    spDay.setAdapter(new ArrayAdapter<String>(this, R.layout.view_spinner, getDays(position + 1)));
    spDay.setSelection(Integer.parseInt(currentDay) - 1);
}
else if (parent.equals(spDay))
{
    currentDay = Integer.toString(position + 1);
    String date = "" + spMonth.getSelectedItem() + spDay.getSelectedItem();
    api.queryHistory(date, this);
}
   }