aspose file tools*
The moose likes Android and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark ""A View as a click Listener" V/s "setting of whole of the activity" as a listener " Watch ""A View as a click Listener" V/s "setting of whole of the activity" as a listener " New topic
Author

"A View as a click Listener" V/s "setting of whole of the activity" as a listener

zoheb hassan
Ranch Hand

Joined: Apr 01, 2009
Posts: 153

How do they differ???

I have the Code for both

Setting a button as a Listener



Setting an activity as an listener



Can You guys help me in Understanding the Diff
Thanks
Zoheb
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9321
    
  17

There is no difference except that when you used the anonymous inner class, you don't need to see which view was clicked but in the activity you may need to if you add on click listener to more than one view...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
zoheb hassan
Ranch Hand

Joined: Apr 01, 2009
Posts: 153

Hi Ankit thanks for responding, Can You please tell me what am i doing wrong here

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: "A View as a click Listener" V/s "setting of whole of the activity" as a listener