0

So I'm trying to start WhatsApp with a predefined message in sl4a using Python. This is my code:

import android
droid = android.Android()

droid.startActivity("android.intent.action.SEND",
                    None, "text/plain",
                    {'com.whatsapp.locale.extras.TEXT':"sl4a test"},
                    False, "com.whatsapp", "classname"
                   )

I don't know if the packagename is right, and I don't know what the classname should be. The syntax is:

startActivity(
   action (String),
   uri (String) (optional),
   type (String) MIME type/subtype of the URI (optional),
   extras (JSONObject) a Map of extras to add to the Intent (optional),
   wait (Boolean) block until the user exits the started activity (optional),
   packagename (String) name of package. If used, requires classname to be useful (optional),
   classname (String) name of class. If used, requires packagename to be useful (optional),
)
alexm
  • 21
  • 4
  • It would help answerers if you could include any error message you got when you tried this – James Aug 27 '16 at 21:40

1 Answers1

0

Nevermind I just figured out that I could set WhatsApp as the standard app in the dialog so I don't have to specify the packagename anyway.

alexm
  • 21
  • 4