TextView setSelected - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:setLayoutParams, setOnCheckedChangeListener, setSelected
        p = new AbsoluteLayout.LayoutParams(IP_WIDTH, AbsoluteLayout.LayoutParams.WRAP_CONTENT, 320
                - IP_WIDTH - INSETS, INSETS - 10);
        edtIpAddress.setLayoutParams(p);
        layout.addView(edtIpAddress);
 
        cbxAccelerometer = new CheckBox(this);
        cbxAccelerometer.setSelected(false);
        p = new AbsoluteLayout.LayoutParams(AbsoluteLayout.LayoutParams.WRAP_CONTENT,
                AbsoluteLayout.LayoutParams.WRAP_CONTENT, 320 - IP_WIDTH - INSETS, 3 * INSETS - 10);
        cbxAccelerometer.setLayoutParams(p);
        cbxAccelerometer.setOnCheckedChangeListener(this);
        layout.addView(cbxAccelerometer);
 
        setContentView(layout);
    } 
 
    /* 
     * (non-Javadoc) 
     *  
     * @see 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setSelected
This code example shows how to use the following methods:isSelected, setCheckMarkDrawable, setSelected
			@Override 
			public boolean onTouch(View v, MotionEvent event) {
				if (event.getAction() == MotionEvent.ACTION_DOWN) {
					// Toggle the checked state of the button 
					CheckedTextView ctv = (CheckedTextView) v;
					if (ctv.isSelected()) {
						ctv.setSelected(false);
						ctv.setCheckMarkDrawable(android.R.drawable.checkbox_off_background);
 
						// remove the position from the list of checked indices 
						mCheckedPositions.remove(index);
					} else { 
						ctv.setSelected(true);
						ctv.setCheckMarkDrawable(android.R.drawable.checkbox_on_background);
						if (!mCheckedPositions.contains(index)) {
							mCheckedPositions.add(index);
						} 
					} 
				} 
				return true; 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setOnCheckedChangeListener, setSelected
        mAnalogVal=(TextView)findViewById(av);		
        mBar.setMax(255);
        mBar.setClickable(true);
        myNumber=number;
		 
        mRadioAD.setOnCheckedChangeListener(this);
//        mRadioG.setOnCheckedChangeListener(this); 
        mD1.setOnClickListener(this);
        mD0.setOnClickListener(this);
        mBar.setOnSeekBarChangeListener(this);
        this.setDigital(0);
        this.setAnalog(0);
        this.mRadioAD.setSelected(true);
	} 
 
	public void attachToView(ViewGroup targetView) {
 
	} 
 
	@Override 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setSelected
    public View newView(Context context, Cursor cursor, ViewGroup parent) {
        LayoutInflater inflater = LayoutInflater.from(context);
        CheckedTextView view = (CheckedTextView)inflater.inflate(
                android.R.layout.simple_list_item_multiple_choice, parent, false);
        view.setText(formatText(context, cursor));
        view.setSelected(true);
        return view;
    } 
 
    @Override 
    public void bindView(View view, Context context, Cursor cursor) {
         ((CheckedTextView)view).setText(formatText(context, cursor));
         // Put the number in tag so it can be retrieved easily 
         view.setTag(cursor.getString(1));
    } 
     
    /** 
     * Format the item to be displayed 
     *  
     * @param context Context 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setSelected
		_dateText.getText().clear();
		_publisherText.getText().clear();
		_pagesText.getText().clear();
		_ratingBar.setRating(.0F);
		_ownedCheckBox.setSelected(false);
		_readCheckBox.setSelected(false);
 
		return true; 
	} 
 
	private Dialog createNeutralDialog(String title, String text) {
		return DialogUtils.createNeutralDialog(this, title, text);
	} 
 
	private class SearchAndGetBook extends AsyncTask<String, ResultBook, ResultBook> {
 
		private boolean moreThanOne = false;
 
		@Override 
		protected void onPreExecute() { 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related TextView setSelected Questions & Answers:

setSelected Method Overview
Changes the selection state of this view.
See Code Examples for other Android TextView Methods: