Example usage for android.widget Spinner setPrompt

List of usage examples for android.widget Spinner setPrompt

Introduction

In this page you can find the example usage for android.widget Spinner setPrompt.

Prototype

public void setPrompt(CharSequence prompt) 

Source Link

Document

Sets the prompt to display when the dialog is shown.

Usage

From source file:com.sentaroh.android.TaskAutomation.Config.ProfileMaintenanceActionProfile.java

final static private void setSpinnerActionType(final GlobalParameters mGlblParms, Dialog dialog,
        Spinner spinner, CustomSpinnerAdapter adapter, String selected) {
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setPrompt(mGlblParms.context.getString(R.string.msgs_edit_profile_action_select_action_type));
    spinner.setAdapter(adapter);/*from www  . j a v  a  2 s. c  o m*/
    adapter.clear();
    adapter.add(PROFILE_ACTION_TYPE_ACTIVITY);
    adapter.add(PROFILE_ACTION_TYPE_BSH_SCRIPT);
    adapter.add(PROFILE_ACTION_TYPE_COMPARE);
    adapter.add(PROFILE_ACTION_TYPE_MESSAGE);
    adapter.add(PROFILE_ACTION_TYPE_MUSIC);
    adapter.add(PROFILE_ACTION_TYPE_RINGTONE);
    adapter.add(PROFILE_ACTION_TYPE_TASK);
    adapter.add(PROFILE_ACTION_TYPE_TIME);
    adapter.add(PROFILE_ACTION_TYPE_WAIT);
    //      adapter.add(PROFILE_ACTION_TYPE_SCRIPT);      
    for (int i = 0; i < adapter.getCount(); i++)
        if (adapter.getItem(i).equals(selected))
            spinner.setSelection(i);

}

From source file:com.sentaroh.android.TaskAutomation.Config.ProfileMaintenanceActionProfile.java

final static private void setSpinnerCompareType(final GlobalParameters mGlblParms, Dialog dialog,
        Spinner spinner, CustomSpinnerAdapter adapter, String selected, boolean c_eq, boolean c_ne,
        boolean c_gt, boolean c_lt, boolean c_bw) {
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setPrompt(mGlblParms.context.getString(R.string.msgs_edit_profile_action_compare_select_type));
    spinner.setAdapter(adapter);//from  w w  w.j a v  a 2 s  . c o  m
    adapter.clear();
    if (c_eq)
        adapter.add(PROFILE_ACTION_TYPE_COMPARE_COMPARE_EQ);
    if (c_ne)
        adapter.add(PROFILE_ACTION_TYPE_COMPARE_CPMPARE_NE);
    if (c_gt)
        adapter.add(PROFILE_ACTION_TYPE_COMPARE_COMPARE_GT);
    if (c_lt)
        adapter.add(PROFILE_ACTION_TYPE_COMPARE_COMPARE_LT);
    if (c_bw)
        adapter.add(PROFILE_ACTION_TYPE_COMPARE_COMPARE_BETWEEN);
    for (int i = 0; i < adapter.getCount(); i++)
        if (adapter.getItem(i).equals(selected)) {
            spinner.setSelection(i);
            break;
        }
}