Code example for Object

Methods: hashCode, addView, setId, setLayoutParams, setVisibility

0
	} 
 
	@Override 
	protected void onAttachedToWindow() { 
		super.onAttachedToWindow(); 
		this.mLayout = new RelativeLayout(mContext);
		LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT,
				LayoutParams.FILL_PARENT);
		params.setMargins(0, 3, 0, 0);
		this.mLayout.setLayoutParams(params);
		this.mButton = new ToggleButton(mContext);
		this.mButton.setText("Torch");
		this.mButton.setTextOn("Torch");
		this.mButton.setTextOff("Torch");
		this.mButton.setWidth(LayoutParams.FILL_PARENT);
		this.mButton
				.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
 
					public void onCheckedChanged(CompoundButton buttonView,
							boolean isChecked) {
						if (isChecked) {
							ledOn(); 
						} else { 
							ledOff(); 
						} 
						return; 
					} 
				}); 
		this.mLayout.setId(this.mLayout.hashCode());
		this.mLayout.addView(mButton);
		addView(mLayout);
 
		if (android.provider.Settings.System.getString(
				mContext.getContentResolver(), "theBase_torchToggle") != null) {
			if (android.provider.Settings.System.getString(
					mContext.getContentResolver(), "theBase_torchToggle")
					.equals("1")) {
				mLayout.setVisibility(0);
			} else { 
				mLayout.setVisibility(8);
			} 
		} 
	} 
 
	public boolean ledOn() { 
Experience pair programming with AI  Get Codota for Java