本文整理汇总了Java中android.nfc.NfcAdapter.CreateBeamUrisCallback类的典型用法代码示例。如果您正苦于以下问题:Java CreateBeamUrisCallback类的具体用法?Java CreateBeamUrisCallback怎么用?Java CreateBeamUrisCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CreateBeamUrisCallback类属于android.nfc.NfcAdapter包,在下文中一共展示了CreateBeamUrisCallback类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupNfcBeamPush
import android.nfc.NfcAdapter.CreateBeamUrisCallback; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private void setupNfcBeamPush() {
NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mAppContext);
if (adapter == null) {
return;
}
if (!ApiHelper.HAS_SET_BEAM_PUSH_URIS) {
// Disable beaming
adapter.setNdefPushMessage(null, CameraActivity.this);
return;
}
adapter.setBeamPushUris(null, CameraActivity.this);
adapter.setBeamPushUrisCallback(new CreateBeamUrisCallback() {
@Override
public Uri[] createBeamUris(NfcEvent event) {
return mNfcPushUris;
}
}, CameraActivity.this);
}
示例2: setupNfcBeamPush
import android.nfc.NfcAdapter.CreateBeamUrisCallback; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private void setupNfcBeamPush() {
NfcAdapter adapter = NfcAdapter.getDefaultAdapter(CameraActivity.this);
if (adapter == null) {
return;
}
if (!ApiHelper.HAS_SET_BEAM_PUSH_URIS) {
// Disable beaming
adapter.setNdefPushMessage(null, CameraActivity.this);
return;
}
adapter.setBeamPushUris(null, CameraActivity.this);
adapter.setBeamPushUrisCallback(new CreateBeamUrisCallback() {
@Override
public Uri[] createBeamUris(NfcEvent event) {
return mNfcPushUris;
}
}, CameraActivity.this);
}
示例3: SelectionManager
import android.nfc.NfcAdapter.CreateBeamUrisCallback; //导入依赖的package包/类
public SelectionManager(Activity activity) {
mActivity = activity;
if (ApiHelper.AT_LEAST_16) {
mNfcAdapter = NfcAdapter.getDefaultAdapter(mActivity);
mNfcAdapter.setBeamPushUrisCallback(new CreateBeamUrisCallback() {
@Override
public Uri[] createBeamUris(NfcEvent arg0) {
// This will have been preceded by a call to onItemSelectedStateChange
if (mCachedShareableUris == null) return null;
return mCachedShareableUris.toArray(
new Uri[mCachedShareableUris.size()]);
}
}, mActivity);
}
}
示例4: setupNfcBeamPush
import android.nfc.NfcAdapter.CreateBeamUrisCallback; //导入依赖的package包/类
@TargetApi(ApiHelper.VERSION_CODES.JELLY_BEAN)
private void setupNfcBeamPush() {
if (!ApiHelper.HAS_SET_BEAM_PUSH_URIS) return;
NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mActivity);
if (adapter != null) {
adapter.setBeamPushUris(null, mActivity);
adapter.setBeamPushUrisCallback(new CreateBeamUrisCallback() {
@Override
public Uri[] createBeamUris(NfcEvent event) {
return mNfcPushUris;
}
}, mActivity);
}
}
示例5: startBeamPushCallBack
import android.nfc.NfcAdapter.CreateBeamUrisCallback; //导入依赖的package包/类
/**
* Call requires API level 16
*
* @param callback
*/
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void startBeamPushCallBack(CreateBeamUrisCallback callback) {
mNfcAdapter.setBeamPushUrisCallback(callback, mActivity);
}