首页 > 解决方案 > 单击按钮时的电子表格特定文件

问题描述

我想在我自己的应用程序上点击按钮打开谷歌电子表格,文件已经在谷歌工作表上创建好了。这是我从我的应用程序打开工作表应用程序的代码,但我想在我自己的应用程序中单击按钮时打开该特定文件。

showBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.google.android.apps.docs.editors.sheets");
            if (launchIntent != null) {
                startActivity(launchIntent);
            } else {
                Toast.makeText(ClassActivity.this, "There is no package available in android", Toast.LENGTH_LONG).show();
            }
        }
    });

标签: androidandroid-studiogoogle-sheetsspreadsheetandroid-button

解决方案


推荐阅读