Hi Everyone,
I am very new to Android development, but I am not new to develoment
of UIs.
I am trying to run this piece of code.
Basically, there is a GridView which contains a bunch of ImageViews.
To each of these image views I have added this
onTouchListener as given below. However, the removeView statement
throws an exception - "Unsupported operation".
It is important for me to remove this view, because I need to attach
it to another layout.
Any help is really appreciated!
this._pieceTouchListener = new OnTouchListener(){
public boolean onTouch(View v, MotionEvent event) {
if(view != null)
{
switch(action)
{
case MotionEvent.ACTION_DOWN:
try {
ViewGroup vg =
(ViewGroup)v.getParent();
//this line throws an
exception
vg.removeView(v);
} catch (Exception exc) {
exc.printStackTrace();
}
......
}
}
}
}
--
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
To unsubscribe from this group, send email to
android-developers+unsubscribegooglegroups.com or reply to this email with the
words "REMOVE ME" as the subject.