Page 1 of 1

How to enter a text string in App?

Posted: 06 Feb 2018 15:43
by Econdoc
I would like to paste some info from the clipboard into an email. I also would like to enter a text string on the subject line of the email...something like "Take a look at this." It was no trouble to launch my email app or to paste the info I wanted into the message body using Control UI. However, I could not figure out how to put a text string in the subject line. Any suggestions?

Re: How to enter a text string in App?

Posted: 06 Feb 2018 16:12
by Desmanto
What email app do you use? If gmail, the subject element Id is com.google.android.gm:id/subject. You can use

Code: Select all

setText2ById("com.google.android.gm:id/subject", "Take a look at this");
If you need to put your clipboard there, just replace the text with your clipboard variable. If you still need to use the old paste method, you need to use the Control UI to focus on the subject element id first, then paste() at there.

But for email, we have the intent activity to do it, which is much more reliable than using Control UI. Check out action Start Activity, examples : Compose Mail. Fill in the variable needed at the extras.

Re: How to enter a text string in App?

Posted: 07 Feb 2018 00:57
by Econdoc
Thanks.
As always, your provided enough info for me to find a solution to my problem.