# Android SDK .callFunction

**URL:** <https://community.particle.io/t/android-sdk-callfunction/19328>\
**Category:** Developer Tools\
**Created:** [January 22, 2016, 1:03am UTC](https://community.particle.io/t/android-sdk-callfunction/19328 "2016-01-22T01:03:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![daviesst](https://avatars.discourse-cdn.com/v4/letter/d/eb8c5e/32.png) [@daviesst](https://community.particle.io/u/daviesst)\
**Post date:** [January 22, 2016, 1:03am UTC](https://community.particle.io/t/android-sdk-callfunction/19328/1 "2016-01-22T01:03:31Z")

</div>

I’m having issues with the .callFunction in Android SDK.

The SDK reference gives it as  
int resultCode = someDevice.callFunction(“digitalwrite”, list(“D7”, “1”));

and the ParticleDevice.java file as  
public int callFunction(@NonNull String functionName, @Nullable List args)

However the List part is giving me issues, and is not used in any of the examples.  
I’m currently just trying to interface with the ledToggle firmware so I have:

```
                    List<String> ledCommands = new ArrayList<String>();
                    ......
                          ledCommands.add("on");

                   .....mDevice.callFunction("ledToggle", ledCommands.get(0));

```

The ledCommands.get(0) part is giving me the exception

```
                  incompatible types required: java.util.ArrayList<java.lang.String> found: java.lang.String

```

Any thoughts?  
I’m new to Android development so I’m guessing this is a simple question.  
Thanks

---

<div class="post-metadata">

**Author:** ![ahmedghoneim92](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ahmedghoneim92/32/8514_2.png) [@ahmedghoneim92](https://community.particle.io/u/ahmedghoneim92)\
**Post date:** [January 22, 2016, 11:49pm UTC](https://community.particle.io/t/android-sdk-callfunction/19328/2 "2016-01-22T23:49:48Z")

</div>

You should pass the ledCommands list directly to callFunction. Remove the .get(0) and it should work 😄
