Organizational Research By

Surprising Reserch Topic

clear text in edittext when entered using -'android,android-edittext'


clear text in edittext when entered  using -'android,android-edittext'

I'm trying to set and onclicklistener so that when I click within the edittext element it will clear its current contents. Is there something wrong here? When I compile this code I get a force quit and  ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined error.

public class Project extends Activity implements OnClickListener {
    /** Called when the activity is first created. */
    EditText editText = (EditText)findViewById(R.id.editText1);
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        editText.setOnClickListener(this);

        setContentView(R.layout.main);

    }

    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub
        editText.setText("");
    }
}

    
asked Sep 7, 2015 by rajesh
0 votes
6 views



Related Hot Questions



Government Jobs Opening


...