谷歌Android驱动器文件更改侦听器无法正常工作 [英] Android google drive file change listener not working

查看:128
本文介绍了谷歌Android驱动器文件更改侦听器无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经注册了改变监听器,谷歌驱动器文件如下: -

I have registered the change listener to google drive file as follows-

DriveFile driveFile = Drive.DriveApi.getFile(mGoogleApiClient, mSelectedFileId);
driveFile.addChangeListener(mGoogleApiClient,changeListener);


 final private Listener<ChangeEvent> changeListener = new Listener<ChangeEvent>() {
    @Override
    public void onEvent(ChangeEvent event) {
        Toast.makeText(MainActivity.this, "File Changed", Toast.LENGTH_LONG).show();
    }
};

当我更改文件的内容通过网络浏览器,然后更改听者called.What是听驱动器文件的更改正确的方法是什么?

when i changing file content through web browser,then change listener is called.What is correct way to listen drive file changes?

推荐答案

我假定你的意思改变监听器不叫。

I assume you mean change listener isn't called.

发在网络上的更改不会立即反映在设备上。它的下一次设备发现关于更新会发生。您可以速度由与API进行交互,或致电requestSync。

Changes made on the web won't immediately be reflected on the device. It will happen the next time that the device finds out about updates. You can speed that up by interacting with the API, or calling requestSync.

这篇关于谷歌Android驱动器文件更改侦听器无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆