TypedArray getTextArray - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:getTextArray, recycle
	 
	public IoSchedPreference(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		 
		TypedArray a = context.obtainStyledAttributes(attrs,R.styleable.mobi_cyann_nstools_preference_IoSchedPreference, defStyle, 0);
		writeToInterfaces = a.getTextArray(R.styleable.mobi_cyann_nstools_preference_IoSchedPreference_writeToInterface);
		a.recycle();
	} 
 
	public IoSchedPreference(Context context, AttributeSet attrs) {
		this(context, attrs, 0);
	} 
 
	public IoSchedPreference(Context context) {
		this(context, null);
	} 
	 
	@Override 
	protected void onBindView(View view) {
		super.onBindView(view);
6
CodeRank
This code example shows how to use the following methods:getTextArray, recycle
		super(context, attrs, defStyle);
		initAbsSpinner(); 
 
		TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CustomAbsSpinner, defStyle, 0);
 
		CharSequence[] entries = a.getTextArray(R.styleable.CustomAbsSpinner_entries);
		if (entries != null) {
			ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(context, R.layout.simple_spinner_item, entries);
			adapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item);
			setAdapter(adapter);
		} 
 
		a.recycle();
	} 
 
	/** 
	 * Common code for different constructor flavors 
	 */ 
	private void initAbsSpinner() { 
		setFocusable(true); 
5
CodeRank
This code example shows how to use the following methods:getTextArray, recycle
        initAbsSpinner(); 
 
        TypedArray a = context.obtainStyledAttributes(attrs,
                R.styleable.CustomAbsSpinner, defStyle, 0);
 
        CharSequence[] entries = a.getTextArray(R.styleable.CustomAbsSpinner_entries);
        if (entries != null) {
            ArrayAdapter<CharSequence> adapter =
                    new ArrayAdapter<CharSequence>(context,
                    		android.R.layout.simple_spinner_item, entries);
            adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
            setAdapter(adapter);
        } 
 
        a.recycle();
    } 
 
    /** 
     * Common code for different constructor flavors 
     */ 
4
CodeRank
This code example shows how to use the following methods:getTextArray, recycle
        initAbsSpinner(); 
 
        TypedArray a = context.obtainStyledAttributes(attrs,
                R.styleable.CustomAbsSpinner, defStyle, 0);
 
        CharSequence[] entries = a.getTextArray(R.styleable.CustomAbsSpinner_entries);
        if (entries != null) {
            ArrayAdapter<CharSequence> adapter =
                    new ArrayAdapter<CharSequence>(context,
                            android.R.layout.simple_spinner_item, entries);
            adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
            setAdapter(adapter);
        } 
 
        a.recycle();
    } 
 
    /** 
     * Common code for different constructor flavors 
     */ 
4
CodeRank

Related TypedArray getTextArray Questions & Answers:

getTextArray Method Overview
Retrieve the CharSequence[] for the attribute at index.
See Code Examples for other Android TypedArray Methods: