package com.android;

public class ClearableEditText extends LinearLayout {

    EditText editText;
    Button clearButton;

    public ClearableEditText(Context context) {
        super(context);
        // TODO Auto-generated constructor stub


        String infService=Context.LAYOUT_INFLATER_SERVICE;
        LayoutInflater li;
        li=(LayoutInflater)getContext().getSystemService(infService);
        li.inflate(R.layout.clearable_edit_text, this, true);

        // Get references to the child controls.
        editText = (EditText)findViewById(R.id.editText1);
        clearButton = (Button)findViewById(R.id.button1);

    }

    private void hookupButton() {
        // TODO Auto-generated method stub

        clearButton.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View v){
                editText.setText("");
            }
        });

    }


    }



.................................................................................
this is prgm from android 2 application devlopment..wrox
ppublications(creating custom views)

is it possible to prgm even without involving activity can we  extend
layouts....?


when tried to run this ..app
it's not getting installed int the emulator..and getting an error ."'
application not installed"

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to