Java Code Examples for android.content.RestrictionEntry#setChoiceEntries()

The following examples show how to use android.content.RestrictionEntry#setChoiceEntries() . 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: GetRestrictionsReceiver.java    From enterprise-samples with Apache License 2.0 5 votes vote down vote up
public static void populateChoiceEntry(Resources res, RestrictionEntry reSingleChoice) {
    String[] choiceEntries = res.getStringArray(R.array.choice_entry_entries);
    String[] choiceValues = res.getStringArray(R.array.choice_entry_values);
    if (reSingleChoice.getSelectedString() == null) {
        reSingleChoice.setSelectedString(choiceValues[0]);
    }
    reSingleChoice.setTitle(res.getString(R.string.choice_entry_title));
    reSingleChoice.setChoiceEntries(choiceEntries);
    reSingleChoice.setChoiceValues(choiceValues);
    reSingleChoice.setType(RestrictionEntry.TYPE_CHOICE);
}
 
Example 2
Source File: GetRestrictionsReceiver.java    From enterprise-samples with Apache License 2.0 5 votes vote down vote up
public static void populateMultiEntry(Resources res, RestrictionEntry reMultiSelect) {
    String[] multiEntries = res.getStringArray(R.array.multi_entry_entries);
    String[] multiValues = res.getStringArray(R.array.multi_entry_values);
    if (reMultiSelect.getAllSelectedStrings() == null) {
        reMultiSelect.setAllSelectedStrings(new String[0]);
    }
    reMultiSelect.setTitle(res.getString(R.string.multi_entry_title));
    reMultiSelect.setChoiceEntries(multiEntries);
    reMultiSelect.setChoiceValues(multiValues);
    reMultiSelect.setType(RestrictionEntry.TYPE_MULTI_SELECT);
}
 
Example 3
Source File: GetRestrictionsReceiver.java    From android-AppRestrictions with Apache License 2.0 5 votes vote down vote up
public static void populateChoiceEntry(Resources res, RestrictionEntry reSingleChoice) {
    String[] choiceEntries = res.getStringArray(R.array.choice_entry_entries);
    String[] choiceValues = res.getStringArray(R.array.choice_entry_values);
    if (reSingleChoice.getSelectedString() == null) {
        reSingleChoice.setSelectedString(choiceValues[0]);
    }
    reSingleChoice.setTitle(res.getString(R.string.choice_entry_title));
    reSingleChoice.setChoiceEntries(choiceEntries);
    reSingleChoice.setChoiceValues(choiceValues);
    reSingleChoice.setType(RestrictionEntry.TYPE_CHOICE);
}
 
Example 4
Source File: GetRestrictionsReceiver.java    From android-AppRestrictions with Apache License 2.0 5 votes vote down vote up
public static void populateMultiEntry(Resources res, RestrictionEntry reMultiSelect) {
    String[] multiEntries = res.getStringArray(R.array.multi_entry_entries);
    String[] multiValues = res.getStringArray(R.array.multi_entry_values);
    if (reMultiSelect.getAllSelectedStrings() == null) {
        reMultiSelect.setAllSelectedStrings(new String[0]);
    }
    reMultiSelect.setTitle(res.getString(R.string.multi_entry_title));
    reMultiSelect.setChoiceEntries(multiEntries);
    reMultiSelect.setChoiceValues(multiValues);
    reMultiSelect.setType(RestrictionEntry.TYPE_MULTI_SELECT);
}