ArrayAdapter setDropDownViewResource - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ArrayAdapter setDropDownViewResource method.

This code example shows how to use the following methods:setDropDownViewResource
		} 
	} 
 
	public static ArrayAdapter<String> newSpinnerAdapter(Context cxt,
			List<String> items) {
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(cxt,
				android.R.layout.simple_spinner_item, items);
		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		return adapter;
	} 
 
	public static void setGray(SpannableString ss, List<String> items) {
		String data = ss.toString();
		for (String item : items) {
			int i = data.indexOf("@" + item);
			if (i != -1) {
				ss.setSpan(new ForegroundColorSpan(Color.GRAY), i,
						i + 1 + item.length(),
						Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
			} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:addAll, setDropDownViewResource
		if (elements != null && elements.size() > 1) {
			name = name + "-" + elements.get(idx);
		} 
		lbl.setText(name);
 
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(context, android.R.layout.simple_spinner_item);
		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		adapter.addAll(field.getOptions());
		spin.setAdapter(adapter);
		spin.setSelection((int) field.getDouble(idx));
	} 
 
	@Override 
	public double getValue() { 
		return value;
	} 
 
	@Override 
	public void setValue(double val) {
		localUpdate = true;
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDropDownViewResource
		// add the string for "new group" 
		mGroupList.add(mAddGroupString);
 
		// XXX 
		mGroupAdapter = new ArrayAdapter<String>(mContext,
				android.R.layout.simple_spinner_item, mGroupList);
		mGroupAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		mGroupSpinner.setAdapter(mGroupAdapter);
		mGroupSpinner.setOnItemSelectedListener(this);
	} 
 
	public String getGroupName() {
		String spinnerItem = mGroupSpinner.getSelectedItem().toString();
		if (spinnerItem.equals(mDefaultGroup)) {
			// return internal representation 
			return ""; 
		} else if (spinnerItem.equals(mAddGroupString)) {
			return mNewGroupInput.getText().toString();
		} else { 
			return spinnerItem;
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDropDownViewResource
  } 
 
  protected void setUpSpinner(int spinnerId, String[] labels) {
    Spinner spinner = (Spinner) findViewById(spinnerId);
    ArrayAdapter<String> adapter =
        new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item,
            labels);
    adapter
        .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(adapter);
  } 
 
  protected void subscribeRequestCommon(Subscribe request) {
    request.setKeepUntil(mKeepUntil);
    request.setPadding(mPaddingStart, mPaddingStop);
  } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDropDownViewResource
        return true; // warn : returning null will disable the callback !!! 
    } 
 
    @Override 
    protected void onNuxeoDataRetrieved(Object data) {
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_spinner_item, opList);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner.setAdapter(adapter);
        spinner.setVisibility(0);
        statusText.setText("Connected : " + opList.size()
                + "operations available"); 
    } 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDropDownViewResource
            return spinner;
        } 
    } 
 
    protected SpinnerAdapter getAdapter(Context ctx, List<String> opList) {
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(ctx,
                android.R.layout.simple_spinner_item, opList);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        return adapter;
    } 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDropDownViewResource
        } 
 
    } 
 
    protected SpinnerAdapter getAdapter(Context ctx, List<String> opList) {
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(ctx,
                android.R.layout.simple_spinner_item, opList);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        return adapter;
    } 
 
    @Override 
    public void onClick(View arg0) {
        int pos = spinner.getSelectedItemPosition();
        String key = widgetDef.getSelectOptions().getItemValue(pos);
        PropertyList values = getCurrentValue();
        if (values == null) {
            values = new PropertyList();
        } 
        values.add(key);
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDropDownViewResource
        if (list != null) {
            listNameCategory = list;
        } else { 
            listNameCategory = new ArrayList<String>();
        } 
        adapter = new ArrayAdapter<String>(acticity, android.R.layout.simple_spinner_item, listNameCategory);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner.setAdapter(adapter);
    } 
 
    public String getSelectedItem() {
        return spinner.getSelectedItem().toString();
    } 
 
    public void setSelection(int position) {
        spinner.setSelection(position);
    } 
 
    @Override 
    public void onItemSelected(AdapterView<?> paramAdapterView, View paramView,
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDropDownViewResource
	 */ 
    public void populateLineSpinner() 
    {	 
		ArrayList<String> linesList = database.getBusLines();
		 
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this.getBaseContext(), android.R.layout.simple_spinner_item, linesList);		
		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		timetableLineSpinner.setAdapter(adapter);	
    } 
     
    /** 
	 * This method populates the timetableStopSpinner with data from the database 
	 */ 
	public void populateStopSpinner() 
	{		 
		List<String> locationList = database.getLineStops(selectedLine);														   
		 
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this.getBaseContext(), android.R.layout.simple_spinner_item, locationList);		
		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		timetableStopSpinner.setAdapter(adapter);		
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDropDownViewResource
		} 
		 
        @Override 
        protected void onPostExecute(ArrayList<String> spinnerArray) {
        	 
    		ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(Welcome.this, android.R.layout.simple_spinner_item, spinnerArray);
    		spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    		netlist.setAdapter(spinnerArrayAdapter);
    		String homeSSID = _settings.getHomeSSID();
    		if(homeSSID!=null)
    			netlist.setSelection(spinnerArray.indexOf(homeSSID));
    		_pd.dismiss();
    		Log.d("AWMonWelcome", "Should have dismissed progress dialogue");
        } 
		 
    } 
	 
    // When the user clicks finished, we save some information locally.  The home network name is 
    // only saved locally (so that our application can work), and it is never shared back with us. 
    public void clickedFinished(View v) {
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related ArrayAdapter setDropDownViewResource Questions & Answers:

Other ArrayAdapter setDropDownViewResource Examples

98:			// Drop down layout style - list view with radio button
99:			dataAdapter
100:					.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
101:	
102:			// attaching data adapter to spinner

Read More

setDropDownViewResource Method Overview
Sets the layout resource to create the drop down views.
See Code Examples for other Android ArrayAdapter Methods: