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


Java CreateBeamUrisCallback类代码示例

本文整理汇总了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);
}
 
开发者ID:jameliu,项目名称:Camera2,代码行数:22,代码来源:CameraActivity.java

示例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);
}
 
开发者ID:asm-products,项目名称:nexus-camera,代码行数:22,代码来源:CameraActivity.java

示例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);
    }
}
 
开发者ID:asm-products,项目名称:nexus-gallery,代码行数:16,代码来源:SelectionManager.java

示例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);
    }
}
 
开发者ID:asm-products,项目名称:nexus-gallery,代码行数:16,代码来源:PhotoPage.java

示例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);
}
 
开发者ID:11-team,项目名称:libNfc,代码行数:10,代码来源:Nfc.java


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