ooVoo SDK初始化问题

时间:2016-06-09 09:39:11

标签: android xml android-layout android-studio oovoo

我在我的项目中遇到问题,当我在我的应用程序中加载oovooLibrary时,它没有响应5秒然后崩溃而没有任何错误。请帮帮我。

我的代码是

        ooVooClient.setContext(app);
        ooVooClient.setLogger(this, LoggerListener.LogLevel.Debug);

        try {
// I am getting no responce for this line
            mConferenceCore = ooVooClient.sharedInstance();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }

2 个答案:

答案 0 :(得分:0)

  private ooVooClient sdk = null;
  private ApplicationSettings settings = null;   

 if (!ooVooClient.isDeviceSupported()) {
                    return;
                }

                settings = new ApplicationSettings(this);

                ooVooClient.setLogger(this, LogLevel.fromString(getSettings().get(ApplicationSettings.LogLevelKey)));
                ooVooClient.setContext(this);

                sdk = ooVooClient.sharedInstance();

选中此https://github.com/oovoodev/Android-SDK-Sample

答案 1 :(得分:0)

我已经解决了这个问题,我从ooVooClient.setContext(app);类调用了MainActivity所以它不接受上下文 - app(getApplicationContext()),所以我在MainApplication.java初始化它并将其存储在静态变量中并在其他类中使用。