michkaravolos / android-scripting

Automatically exported from code.google.com/p/android-scripting
0 stars 0 forks source link

SL4A Force Close on droid.startActivityIntent(chooserIntent) #588

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What device(s) are you experiencing the problem on?
Samsung Vibrant (SGH-T959)

What firmware version are you running on the device?
2.2

What steps will reproduce the problem?
1. Run the attached Python script on an Android device with SL4Ar4
-or-
1. Make an intent with action="android.intent.action.SEND", uriType = 
"text/plain", extras = {"EXTRA_TEXT":"my message", "EXTRA_SUBJECT":"and my 
subject"}, and everything else = None.
2. Make another intent with action = "android.intent.action.CHOOSER", extras = 
{"EXTRA_INTENT":theFirstIntent}, and everything else = None.
3. droid.startActivityIntent(yourSecondIntent)
4. SL4A force closes

What is the expected output? What do you see instead?
I'm trying to get a chooser for sharing text via other apps (Gmail, Messaging, 
etc.). It should be just like the one from the "Share" option in the menu of 
SL4A's script editor activity. Instead, SL4A force closes, and there's no 
indication whatsoever to the Python interpreter.

What version of the product are you using? On what operating system?
I'm using SL4Ar4 on Samung's OEM build FROYO.UVKB5
My development machine is Windows 7 64-bit, but running the script directly on 
the phone still crashes, so that's probably not the issue.

Please provide any additional information below.
I tried to adapt the code from the "Share" option of the SL4A script editor by 
manually making the same intent as Intent.createChooser() as described in the 
Android documentation.

My script is adapted from lines 198-202 here:
http://code.google.com/p/android-scripting/source/diff?spec=svndeba523e8a9b44ea6
ef6e2497e21914084b109a8&r=deba523e8a9b44ea6ef6e2497e21914084b109a8&format=side&p
ath=/android/ScriptingLayerForAndroid/src/com/googlecode/android_scripting/activ
ity/ScriptEditor.java

And this describes how to make the chooser intent:
http://developer.android.com/reference/android/content/Intent.html#ACTION_CHOOSE
R

Original issue reported on code.google.com by armadaje...@gmail.com on 5 Dec 2011 at 12:55

Attachments:

GoogleCodeExporter commented 9 years ago
Not going to work as sl4a currently stands, sadly, because there is currently 
no way of telling the interpreter that you are passing an Intent as distinct 
from any other class.
I shall think on it....

Original comment by rjmatthews62 on 5 Dec 2011 at 1:30

GoogleCodeExporter commented 9 years ago
Okay, thanks for your help!

Original comment by armadaje...@gmail.com on 5 Dec 2011 at 2:22