【问题标题】:Send file to app with intents using Tasker使用 Tasker 将文件发送到带有意图的应用程序
【发布时间】:2020-03-30 01:36:10
【问题描述】:

使用应用程序“Total Commander”(Link),我可以选择一个 .csv 文件并“打开”我选择的应用程序“我的预算簿”(Link - 付费应用程序)。如果我想导入数据,这会打开应用程序并提示用户。我试图这样做,而不是从 Tasker。

有一点我觉得奇怪,我无法从我的库存 (Samsung S8+) 文件浏览器中执行此操作?

tl;dr 我需要帮助重新创建将文件共享到“我的预算簿”以供导入的意图。

我联系了“我的预算书”的开发者,他们给了我这个:

ImportCsvActivity:
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>

            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>

            <data
                android:mimeType="text/csv"
                android:pathPattern=".*\\.csv"
                android:scheme="content"
                tools:ignore="AppLinkUrlError"/>
            <data
                android:mimeType="text/csv"
                android:pathPattern=".*\\.CSV"
                android:scheme="content"
                tools:ignore="AppLinkUrlError"/>
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>

            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>

            <data
                android:host="*"
                android:mimeType="*/*"
                android:pathPattern=".*\\.csv"
                android:scheme="file"/>
            <data
                android:host="*"
                android:mimeType="*/*"
                android:pathPattern=".*\\.CSV"
                android:scheme="file"/>
        </intent-filter>

我一直在尝试使用 Tasker Java 操作在线遵循指南,但到目前为止,我最多只能在“导入 CSV”页面上启动应用程序,但它不会提示导入。

使用“意图拦截”(Link) 我明白了:

    intent:///storage/emulated/0/My%20Budget%20Book/TaskerImport_1584702040.csv#Intent;scheme=file;type=text/comma-separated-values;launchFlags=0x13100000;end 
------------ 
ACTION: android.intent.action.VIEW 
DATA: file:///storage/emulated/0/My%20Budget%20Book/TaskerImport_1584702040.csv 
MIME: text/comma-separated-values 
URI: intent:///storage/emulated/0/My%20Budget%20Book/TaskerImport_1584702040.csv#Intent;scheme=file;type=text/comma-separated-values;launchFlags=0x13100000;end 
FLAGS: 
FLAG_RECEIVER_FOREGROUND 
FLAG_ACTIVITY_FORWARD_RESULT 
FLAG_ACTIVITY_PREVIOUS_IS_TOP 
FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY 

------------ 
MATCHING ACTIVITIES: 
Excel (com.microsoft.office.excel - com.microsoft.office.excel.excelMainActivity) 
anWriter free (com.ansm.anwriter - com.ansm.anwriter.MainActivityFree) 
Totalcmd-Editor (com.ghisler.android.TotalCommander - com.ghisler.android.TotalCommander.TCEditActivity) 
Sheets (com.google.android.apps.docs.editors.sheets - com.google.android.apps.docs.editors.trix.quicksheet.QuickSheetDocumentOpenerActivityAlias) 
CSV import (com.onetwoapps.mh - com.onetwoapps.mh.ImportCsvActivity) 
QuickEdit (com.rhmsoft.edit - com.rhmsoft.edit.activity.MainActivity) 

我目前的任务:

Intent Testing (13)
    A1: Java Function [ Return:theIntent Class Or Object:Intent Function:new
{Intent} () Param:Intent.ACTION_SEND Param: Param: Param: Param: Param: Param: ] 
    A2: Java Function [ Return: Class Or Object:theIntent Function:setAction
{Intent} (String) Param:android.intent.action.VIEW Param: Param: Param: Param: Param: Param: ] 
    A3: Java Function [ Return: Class Or Object:theIntent Function:setClassName
{Intent} (String, String) Param:com.onetwoapps.mh Param:com.onetwoapps.mh.ImportCsvActivity Param: Param: Param: Param: Param: ] 
    A4: Java Function [ Return: Class Or Object:theIntent Function:addFlags
{Intent} (int) Param:theIntent.FLAG_ACTIVITY_NEW_TASK Param: Param: Param: Param: Param: Param: ] 
    A5: Java Function [ Return:parsedurl Class Or Object:Uri Function:parse
{Uri} (String) Param:file:///My Budget Book/TaskerImport_1584702040.csv Param: Param: Param: Param: Param: Param: ] 
    A6: Java Function [ Return: Class Or Object:theIntent Function:putExtra
{Intent} (String, Parcelable) Param:android.intent.extra.STREAM Param:parsedurl Param: Param: Param: Param: Param: ] 
    A7: Java Function [ Return: Class Or Object:CONTEXT Function:startActivity
{} (Intent) Param:theIntent Param: Param: Param: Param: Param: Param: ] 

编辑:我需要帮助重新创建将 Tasker 生成的文件共享到“我的预算簿”以供导入的意图。

非常感谢任何帮助,谢谢!

【问题讨论】:

  • 问题是什么?如果您寻求对 Tasker 的支持,这可能是属于 Android Enthusiasts
  • @MartinZeitler 我已经更新了 OP,我正在尝试使用 tasker 发送我的预算书的意图以导入由 Tasker 生成的文件。

标签: android android-intent tasker


【解决方案1】:

使用 Tasker ADB Wifi 操作解决:

am start -a android.intent.action.VIEW -d file://%filepath -t text/comma/separated-values -n come.onetwoapps.mh/.ImportCsvActivity

文件路径名中的“空格”需要转换为“%20”

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-19
    • 1970-01-01
    相关资源
    最近更新 更多