Finish (Close) a Android Activity on Touch -
how terminate activity in adroid on touch. here shows view described in details.xml. need dismiss activity on touch. tried following code. not working. ideas?
public class details extends activity { protected void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); setcontentview(r.layout.details); } public boolean ontouchevent(motionevent event){ this.finish(); return true; } }
your ontouchevent() called if no other views under finger in view hierarchy have consumed event. uncommon, since many views interact touch events.
it wrong stuff in ontouchevent() without @ actual event is.
generally should implement view reacts touches , appropriate thing.
Comments
Post a Comment