Search cards with intents

DonCachopo

举人
Hi. Is there a intent I can use from another app to perform searches of flashcards ?
I would love to use tasker with this.
Thanks
 

Shun

状元
Hi, can I ask a short follow-up question? On Android, is there a URI that opens Pleco and makes it jump to the Clipboard Reader? I have an app that copies text to the clipboard and then tries to open Pleco's Clipboard Reader, but right now it opens the Dictionary only. Thanks!
 

mikelove

皇帝
Staff member
Not through a URI, no. You can do it with a regular old text sharing action though - android.intent.action.SEND or android.intent.action.VIEW directed to PlecoDocumentReaderActivity.
 

Shun

状元
Hello Mike,

thank you for your help thus far. Allow me to paste in a question:

Not through a URI, no. You can do it with a regular old text sharing action though - android.intent.action.SEND or android.intent.action.VIEW directed to PlecoDocumentReaderActivity.
We are using Flutter, and we would like to open the Pleco app from our app and direct it to the Clipboard Reader. The following code only opens the Pleco app, but not the Clipboard Reader:

Code:
const intent = AndroidIntent(
    //action: 'android.content.Intent.ACTION_SEND',  action: 'android.content.Intent.ACTION_VIEW',
     package:'com.pleco.chinesesystem',
    componentName:"com.pleco.chinesesystem.PlecoDocumentReaderActivity",
    category:"Intent.CATEGORY_LAUNCHER",
    type:"text/plain",
    flags:<int>[Flag.FLAG_ACTIVITY_NEW_TASK,Flag.FLAG_ACTIVITY_CLEAR_TOP,Flag.FLAG_ACTIVITY_SINGLE_TOP],
    arguments: {
      "android.content.Intent.EXTRA_TEXT": "隐藏全部"   },

);

await intent.launch();
We are using the library android_intent_plus: ^3.1.1.

Do you perhaps recognize a problem right away? If you do and it's somehow related to Pleco, we'd love to hear it.

Many thanks,

Shun
 
Last edited:

mikelove

皇帝
Staff member
I think CATEGORY_LAUNCHER is the problem here - is it not working with ACTION_SEND or ACTION_VIEW?
 

Shun

状元
I thank you again for your help. In case someone finds themselves in the same situation, our main programmer has now got it working with the following code:

Code:
const intent = AndroidIntent(
  action: 'android.content.Intent.ACTION_VIEW',
  package:'com.pleco.chinesesystem',
  componentName:"com.pleco.chinesesystem.PlecoDocumentReaderActivity",
  category:"Intent.CATEGORY_LAUNCHER",
  type:"text/plain",
  flags:<int>[Flag.FLAG_ACTIVITY_NEW_TASK,Flag.FLAG_ACTIVITY_CLEAR_TOP,Flag.FLAG_ACTIVITY_SINGLE_TOP],
  arguments: {
    "android.content.Intent.EXTRA_TEXT": "test"  },

);

await intent.launch();
 
Last edited:
Top