VERY VERY COOL! I'll revisit the page soon to apply my thanks
--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/groups/opt_out.
... and thank you.
but, can you explain this statement more?
public void onClickWhatsApp(View view) {
Intent waIntent = new Intent(Intent.ACTION_SEND);
waIntent.setType("text/plain");
String text = "YOUR TEXT HERE";
waIntent.setPackage("com.whatsapp");
if (waIntent != null) {
waIntent.putExtra(Intent.EXTRA_TEXT, text);//
startActivity(Intent.createChooser(waIntent, "Share with"));
} else {
Toast.makeText(this, "WhatsApp not Installed", Toast.LENGTH_SHORT)
.show();
}
}
How about WhatsApp?
There are a few threads on stackoverflow on how to send a message throught WhatsApp, but I couldn't figure out how to apply it in Tasker.For example:public void onClickWhatsApp(View view) { Intent waIntent = new Intent(Intent.ACTION_SEND); waIntent.setType("text/plain"); String text = "YOUR TEXT HERE"; waIntent.setPackage("com.whatsapp"); if (waIntent != null) { waIntent.putExtra(Intent.EXTRA_TEXT, text);// startActivity(Intent.createChooser(waIntent, "Share with")); } else { Toast.makeText(this, "WhatsApp not Installed", Toast.LENGTH_SHORT) .show(); } }
What goes where in order to send a predefined message?
I hope this too, helps
I am still learning intents, but this is what I have so far.
There's another way to do these that includes using a format of /.EXTRA_NAME.
If anyone knows how to use this format to get to the extra information available form let's say the BatteryManager, an example would be great!
Cazmaz
Hi all ...
SendIntent (85)
A1: Send Intent [ Action:android.intent.action.SENDTO
Cat:Default
mime Type:
Data:mailto:som...@somedomain.com?subject=Test%20this&body=This%20is%20tedeous
Extra:
Extra:
Package:com.fsck.k9
Class: Target:Activity ]
There are a few things to note here.
1. The entry for the data: must be URI encoded, so spaces are %20, not + as in URL encoding.
2. You can use text/*, or text/plain for the mime type, but in this case, I left it blank.
3. Without the package name (com.fsck.k9), Android will bring up a chooser for the completion of the task to send the data, but with it, it brings up the compose screen pre-filled with the data.
4. No Extras needed in this case.
5. Target is Activity.
...