如何在Android中获取谷歌驱动器共享链接

时间:2019-07-11 12:15:23

标签: android android-studio google-drive-api google-drive-android-api

我正在开发一个使用Google云端硬盘的应用。我想获取公共共享链接。

Share Option

Get share link

2 个答案:

答案 0 :(得分:0)

例如:

    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.

        switch (item.getItemId()) {
            case R.id.get_shared_resource:
                startLink();
                break;
            default:
                // ...
        }
    }

    private void startLink() {
        Intent i = new Intent(Intent.ACTION_VIEW);
        i.setData(Uri.parse(https://drive.google.com/...));
        startActivity(i);
    }

答案 1 :(得分:0)

使用已弃用的Google云端硬盘API不可能实现此功能,几个月后它们将被完全关闭:

https://developers.google.com/drive/android/deprecation

December 6, 2019

The Drive Android API is shut down and all connection attempts will be refused. Clients must migrate by this date.