Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending intent with bundle using console

I'm developing an Android app listening for specific intent containing a bundle with some data. I would like to send an intent to my app using adb. I have tried with:

adb shell am startservice -a com.INTENT_NAME -e myBundleName myBundleData com.pkg/com.pkg.cls

but my app recognised it as list of string not as a bundle. Does anyone know how to send intent with bundles using am application? Unfortunately documentation says only about sending lists of string or numbers, nothing about bundle.

like image 285
blazej Avatar asked Jan 10 '23 15:01

blazej


1 Answers

According to the source code am has no way of accepting input data of the bundle type

Update: In Android 7.0 the intent parameters parsing code has been moved from Am.java to Intent.java and support for more data types (like Array[] and ArrayList<> of basic types) has been added. Unfortunately there is still no support for the Bundle type extras in am command.

like image 177
Alex P. Avatar answered Jan 20 '23 17:01

Alex P.