当前位置: 首页>>代码示例>>Java>>正文


Java OnPrimaryClipChangedListener类代码示例

本文整理汇总了Java中android.content.ClipboardManager.OnPrimaryClipChangedListener的典型用法代码示例。如果您正苦于以下问题:Java OnPrimaryClipChangedListener类的具体用法?Java OnPrimaryClipChangedListener怎么用?Java OnPrimaryClipChangedListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OnPrimaryClipChangedListener类属于android.content.ClipboardManager包,在下文中一共展示了OnPrimaryClipChangedListener类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: call

import android.content.ClipboardManager.OnPrimaryClipChangedListener; //导入依赖的package包/类
@Override public void call(final Subscriber<? super String> subscriber) {
  final OnPrimaryClipChangedListener listener = new OnPrimaryClipChangedListener() {
    @Override public void onPrimaryClipChanged() {
      if (!subscriber.isUnsubscribed()) {
        propagate(subscriber);
      }
    }
  };
  clipboard.addPrimaryClipChangedListener(listener);

  subscriber.add(new BaseUnsubscription() {
    @Override protected void onUnsubscribe() {
      clipboard.removePrimaryClipChangedListener(listener);
    }
  });

  propagate(subscriber);
}
 
开发者ID:zsavely,项目名称:RxClipboard,代码行数:19,代码来源:ClipboardHtmlOnSubscribe.java

示例2: call

import android.content.ClipboardManager.OnPrimaryClipChangedListener; //导入依赖的package包/类
@Override public void call(final Subscriber<? super Intent> subscriber) {
  final OnPrimaryClipChangedListener listener = new OnPrimaryClipChangedListener() {
    @Override public void onPrimaryClipChanged() {
      if (!subscriber.isUnsubscribed()) {
        propagate(subscriber);
      }
    }
  };
  clipboard.addPrimaryClipChangedListener(listener);

  subscriber.add(new BaseUnsubscription() {
    @Override protected void onUnsubscribe() {
      clipboard.removePrimaryClipChangedListener(listener);
    }
  });

  propagate(subscriber);
}
 
开发者ID:zsavely,项目名称:RxClipboard,代码行数:19,代码来源:ClipboardIntentOnSubscribe.java

示例3: call

import android.content.ClipboardManager.OnPrimaryClipChangedListener; //导入依赖的package包/类
@Override public void call(final Subscriber<? super ClipData> subscriber) {
  final OnPrimaryClipChangedListener listener = new OnPrimaryClipChangedListener() {
    @Override public void onPrimaryClipChanged() {
      if (!subscriber.isUnsubscribed()) {
        propagate(subscriber);
      }
    }
  };
  clipboard.addPrimaryClipChangedListener(listener);

  subscriber.add(new BaseUnsubscription() {
    @Override protected void onUnsubscribe() {
      clipboard.removePrimaryClipChangedListener(listener);
    }
  });

  propagate(subscriber);
}
 
开发者ID:zsavely,项目名称:RxClipboard,代码行数:19,代码来源:ClipboardClipOnSubscribe.java

示例4: call

import android.content.ClipboardManager.OnPrimaryClipChangedListener; //导入依赖的package包/类
@Override public void call(final Subscriber<? super Uri> subscriber) {
  final OnPrimaryClipChangedListener listener = new OnPrimaryClipChangedListener() {
    @Override public void onPrimaryClipChanged() {
      if (!subscriber.isUnsubscribed()) {
        propagate(subscriber);
      }
    }
  };
  clipboard.addPrimaryClipChangedListener(listener);

  subscriber.add(new BaseUnsubscription() {
    @Override protected void onUnsubscribe() {
      clipboard.removePrimaryClipChangedListener(listener);
    }
  });

  propagate(subscriber);
}
 
开发者ID:zsavely,项目名称:RxClipboard,代码行数:19,代码来源:ClipboardUriOnSubscribe.java

示例5: createListener

import android.content.ClipboardManager.OnPrimaryClipChangedListener; //导入依赖的package包/类
@Override
protected OnPrimaryClipChangedListener createListener() {
    return new OnPrimaryClipChangedListener() {
        public void onPrimaryClipChanged() {
            performClipboardCheck();
        }
    };
}
 
开发者ID:orionlee,项目名称:aDictOnCopy,代码行数:9,代码来源:DictionaryOnCopyService.java

示例6: setListener

import android.content.ClipboardManager.OnPrimaryClipChangedListener; //导入依赖的package包/类
public void setListener(final Context context, final Runnable listener)
{
	ClipboardManager clipboard = (ClipboardManager) context.getSystemService(context.CLIPBOARD_SERVICE);
	clipboard.addPrimaryClipChangedListener(new OnPrimaryClipChangedListener()
	{
		public void onPrimaryClipChanged()
		{
			listener.run();
		}
	});
}
 
开发者ID:NeoTerm,项目名称:NeoTerm,代码行数:12,代码来源:Clipboard.java

示例7: setPrimaryClip

import android.content.ClipboardManager.OnPrimaryClipChangedListener; //导入依赖的package包/类
@Implementation
public void setPrimaryClip(ClipData clip) {
  if (clip != null) {
     clip.prepareToLeaveProcess();
  }
  this.clip = clip;

  for (OnPrimaryClipChangedListener listener : listeners) {
    listener.onPrimaryClipChanged();
  }
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:12,代码来源:ShadowClipboardManager.java

示例8: addPrimaryClipChangedListener

import android.content.ClipboardManager.OnPrimaryClipChangedListener; //导入依赖的package包/类
@Implementation
public void addPrimaryClipChangedListener(OnPrimaryClipChangedListener listener) {
  listeners.add(listener);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:5,代码来源:ShadowClipboardManager.java

示例9: removePrimaryClipChangedListener

import android.content.ClipboardManager.OnPrimaryClipChangedListener; //导入依赖的package包/类
@Implementation
public void removePrimaryClipChangedListener(OnPrimaryClipChangedListener listener) {
  listeners.remove(listener);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:5,代码来源:ShadowClipboardManager.java


注:本文中的android.content.ClipboardManager.OnPrimaryClipChangedListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。