tags:

views:

96

answers:

1

When user copy or paste on TextView, Is there anyone explains me what happen on TextView. If some methods called while user click 'Copy' or 'Paste' in menus, I'd like to hook them and replace them with my own one.

Here is what I want to do. 1. user copy or paste some string to my TextView. 2. some string copied and paste on my Textview. 3. Before some string is added on Textview, I want to check or change string.

+1  A: 

You should be able to do this with the onTextContextMenuItem() method checking for copy or paste.

Alternatively you can use a TextWatcher to monitor changes in a TextView but this doesn't differentiate between typing and cutting and pasting. Add a TextWatcher with the addTextChangedListener() method.

Dave Webb