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


Java TangoOutOfDateException类代码示例

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


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

示例1: connectAndStart

import com.google.atap.tangoservice.TangoOutOfDateException; //导入依赖的package包/类
/**
 * Connect to Tango service and connect the camera to the renderer.
 */
private void connectAndStart() {
    // Synchronize against disconnecting while the service is being used in the OpenGL thread or
    // in the UI thread.

    if (!mIsConnected) {
        // Initialize Tango Service as a normal Android Service, since we call
        // mTango.disconnect() in onPause, this will unbind Tango Service, so
        // everytime when onResume get called, we should create a new Tango object.
        mTango = new Tango(FloorplanActivity.this, new Runnable() {
            // Pass in a Runnable to be called from UI thread when Tango is ready,
            // this Runnable will be running on a new thread.
            // When Tango is ready, we can call Tango functions safely here only
            // when there is no UI thread changes involved.
            @Override
            public void run() {
                try {
                    synchronized (FloorplanActivity.this) {
                        TangoSupport.initialize();
                        connectTango();
                        connectRenderer();
                        mIsConnected = true;
                    }
                } catch (TangoOutOfDateException e) {
                    Log.e(TAG, getString(R.string.exception_out_of_date), e);
                }
            }
        });
    }

}
 
开发者ID:tdb-alcorn,项目名称:defect-party,代码行数:34,代码来源:FloorplanActivity.java

示例2: onResume

import com.google.atap.tangoservice.TangoOutOfDateException; //导入依赖的package包/类
@Override
protected void onResume() {
    super.onResume();
    synchronized (this) {
        if (tangoIsConnected.compareAndSet(false, true)) {
            try {
                connectTango();
                connectRenderer();
            } catch (TangoOutOfDateException e) {
                message(R.string.exception_out_of_date);
            }
        }
    }
}
 
开发者ID:inovex,项目名称:tango-ar-navigation-example,代码行数:15,代码来源:MainActivity.java


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