3

There is a problem, when i use OnPrimaryClipChangedListener to lesten clipboard change.
it always get twice. can somebody help me?

Code is like this:

private OnPrimaryClipChangedListener clipListener = new OnPrimaryClipChangedListener() {
    @Override
    public void onPrimaryClipChanged() {
        Log.d("mytag", '--------->clip--------->');
    }
}

when I clip, I get two logs output. Does someone has the same problem?

D/mytag --------->clip--------->
D/mytag --------->clip--------->

Omar
  • 32,302
  • 9
  • 69
  • 112
user808749
  • 99
  • 5
  • 2
    It does not get called twice, but it gets called once per registered PrimaryClipChangedListener. Usually the double (or multiple) calls happen, when you accidentally register your Listener more than once. Can you post some code of where and how you register your Listener? – pgschk Mar 15 '13 at 16:51
  • Please check this...http://stackoverflow.com/questions/18391701/clipboardmanager-onprimaryclipchangedlistener-is-called-twice-for-every-copy?answertab=oldest#tab-top –  Sep 17 '13 at 08:56
  • printing 3 times in my case. – Shridutt Kothari Dec 25 '14 at 18:59
  • I solve this problem, see my answer : http://stackoverflow.com/questions/18391701/clipboardmanager-onprimaryclipchangedlistener-is-called-twice-for-every-copy/28230843#28230843 – HenryChuang Jan 30 '15 at 07:07

0 Answers0