I am inflating a view using service in android. I want to add listener
to button in the view. But i am facing not responding error.
Here's my code :
LayoutInflater layoutInflater =
(LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view=layoutInflater.inflate(R.layout.example,null);
Button btn = (Button) view.findViewById(R.id.Button01);
btn.setOnClickListener(myClickListener);
myClickListener = new OnClickListener() {
public void onClick(View v) {
Toast.makeText(this, "My button clicked",
Toast.LENGTH_LONG).show();
}
wm.addView(view, localLayoutParams);
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en