# Error in segmentedControl under Android

**URL:** <https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085>\
**Category:** Widgets\
**Created:** [December 26, 2013, 9:19am UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085 "2013-12-26T09:19:49Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fersoft](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/f/59ef9b/32.png) [@Fersoft](https://forums.solar2d.com/u/Fersoft)\
**Post date:** [December 26, 2013, 9:19am UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/1 "2013-12-26T09:19:49Z")

</div>

Hi.

I’ve updated my app to the last public release (I wore several months without updating).

My first action was disable v2 graphics.

```
application =&nbsp; { content = { graphicsCompatibility = 1, ...

```

In various scenes of my app, I’ve a segmentedControl. In Corona Emulator I don’t have any problem but when I run my app in my tablet (Android 4.0.4) it show a error message when try to create the segmentedControl. The error ocurrs in widget code, check the next lines (.

```
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-- Create the labels &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local label &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if \_widget.isSeven() then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;label = display.newText( segmentedControl, segments[i], 0, 0, opt.labelFont, opt.labelSize ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if view.\_segmentNumber == i or opt.defaultSegment == i then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;label:setFillColor( unpack( view.\_labelColor.over ) ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;label:setFillColor( unpack( view.\_labelColor.default ) ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;label = display.newEmbossedText( segmentedControl, segments[i], 0, 0, opt.labelFont, opt.labelSize ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;label:setFillColor( unpack( whiteColor ) ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;

```

The error ocurrs in “else” part of isSeven control structure when it execute “setFillColor” method to the embossedText.

The error message is “attempt to call method ‘setFillColor’ (a nil value)”.

I’ve observed that the same error occurs in others parts of widget, ever when setFillColor is executed in a embossedText object.

With the code of widget I can solve replacing “setFillColor” with “setTextColor” but I don’t understand why occur this errors.

---

<div class="post-metadata">

**Author:** ![Fersoft](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/f/59ef9b/32.png) [@Fersoft](https://forums.solar2d.com/u/Fersoft)\
**Post date:** [December 26, 2013, 9:28am UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/2 "2013-12-26T09:28:49Z")

</div>

Sorry, the same error also occurs, sometimes, in widget.newButtom.

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [December 26, 2013, 6:01pm UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/3 "2013-12-26T18:01:01Z")

</div>

What version of Corona SDK are you using?

With the G2.0 builds we changed the text objects to use setFillColor() instead of setTextColor().&nbsp; These should not be giving you an error.&nbsp; Since you are looking at the widget source, are you using the widgets as shipped with Corona or the downloaded version from GitHub?&nbsp; If you’re using the downloaded version do you have the latest version?

Rob

---

<div class="post-metadata">

**Author:** ![Fersoft](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/f/59ef9b/32.png) [@Fersoft](https://forums.solar2d.com/u/Fersoft)\
**Post date:** [December 26, 2013, 6:37pm UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/4 "2013-12-26T18:37:07Z")

</div>

Hi, Rob.

I’m using 2013.2100 version of Corona SDK and I’ve downloaded widget code from GitHub the last monday (12/23).

Thanks.

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [December 26, 2013, 6:42pm UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/5 "2013-12-26T18:42:24Z")

</div>

Can you try with the latest daily build and use the version that comes with it?

Rob

---

<div class="post-metadata">

**Author:** ![Fersoft](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/f/59ef9b/32.png) [@Fersoft](https://forums.solar2d.com/u/Fersoft)\
**Post date:** [December 27, 2013, 10:23am UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/6 "2013-12-27T10:23:42Z")

</div>

I just try with lastest daily build and his widget and it’s occurs the same.

I attach a image with error log,

Note that the error line is inside widget library, at execute ‘setFillColor’. See the code block of my first post.

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [December 28, 2013, 5:47am UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/7 "2013-12-28T05:47:32Z")

</div>

Engineering is looking into it.

Rob

---

<div class="post-metadata">

**Author:** ![walkerjohn723](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/w/ecd19e/32.png) [@walkerjohn723](https://forums.solar2d.com/u/walkerjohn723)\
**Post date:** [December 28, 2013, 8:06am UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/8 "2013-12-28T08:06:55Z")

</div>

> [@Fersoft](#):
>
> Sorry, the same error also occurs, sometimes, in widget.newButtom.

Exactly. I think I must know about the verson for the compatibilty as this will only work with some perticular version

---

<div class="post-metadata">

**Author:** ![Fersoft](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/f/59ef9b/32.png) [@Fersoft](https://forums.solar2d.com/u/Fersoft)\
**Post date:** [January 3, 2014, 11:12am UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/9 "2014-01-03T11:12:40Z")

</div>

Hi, Rob.

Has you opened a “casenum”?

Thanks.

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [January 3, 2014, 4:31pm UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/10 "2014-01-03T16:31:15Z")

</div>

I can’t really open bugs for you.&nbsp; You have the test case and the setup information the bug form needs.&nbsp; When I contact engineering, I can get them to look at things, but it doesn’t generate a trackable bug.&nbsp; While I believe this may be addressed in the next batch of widget fixes, just to make sure it stays on the radar, can you file a bug report and when you get the email confirmation, post the bugID back to this thread?

Thanks

Rob

---

<div class="post-metadata">

**Author:** ![Fersoft](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/f/59ef9b/32.png) [@Fersoft](https://forums.solar2d.com/u/Fersoft)\
**Post date:** [December 26, 2013, 9:28am UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/11 "2013-12-26T09:28:49Z")

</div>

Sorry, the same error also occurs, sometimes, in widget.newButtom.

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [December 26, 2013, 6:01pm UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/12 "2013-12-26T18:01:01Z")

</div>

What version of Corona SDK are you using?

With the G2.0 builds we changed the text objects to use setFillColor() instead of setTextColor().&nbsp; These should not be giving you an error.&nbsp; Since you are looking at the widget source, are you using the widgets as shipped with Corona or the downloaded version from GitHub?&nbsp; If you’re using the downloaded version do you have the latest version?

Rob

---

<div class="post-metadata">

**Author:** ![Fersoft](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/f/59ef9b/32.png) [@Fersoft](https://forums.solar2d.com/u/Fersoft)\
**Post date:** [December 26, 2013, 6:37pm UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/13 "2013-12-26T18:37:07Z")

</div>

Hi, Rob.

I’m using 2013.2100 version of Corona SDK and I’ve downloaded widget code from GitHub the last monday (12/23).

Thanks.

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [December 26, 2013, 6:42pm UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/14 "2013-12-26T18:42:24Z")

</div>

Can you try with the latest daily build and use the version that comes with it?

Rob

---

<div class="post-metadata">

**Author:** ![Fersoft](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/f/59ef9b/32.png) [@Fersoft](https://forums.solar2d.com/u/Fersoft)\
**Post date:** [December 27, 2013, 10:23am UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/15 "2013-12-27T10:23:42Z")

</div>

I just try with lastest daily build and his widget and it’s occurs the same.

I attach a image with error log,

Note that the error line is inside widget library, at execute ‘setFillColor’. See the code block of my first post.

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [December 28, 2013, 5:47am UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/16 "2013-12-28T05:47:32Z")

</div>

Engineering is looking into it.

Rob

---

<div class="post-metadata">

**Author:** ![walkerjohn723](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/w/ecd19e/32.png) [@walkerjohn723](https://forums.solar2d.com/u/walkerjohn723)\
**Post date:** [December 28, 2013, 8:06am UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/17 "2013-12-28T08:06:55Z")

</div>

> [@Fersoft](#):
>
> Sorry, the same error also occurs, sometimes, in widget.newButtom.

Exactly. I think I must know about the verson for the compatibilty as this will only work with some perticular version

---

<div class="post-metadata">

**Author:** ![Fersoft](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/f/59ef9b/32.png) [@Fersoft](https://forums.solar2d.com/u/Fersoft)\
**Post date:** [January 3, 2014, 11:12am UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/18 "2014-01-03T11:12:40Z")

</div>

Hi, Rob.

Has you opened a “casenum”?

Thanks.

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [January 3, 2014, 4:31pm UTC](https://forums.solar2d.com/t/error-in-segmentedcontrol-under-android/321085/19 "2014-01-03T16:31:15Z")

</div>

I can’t really open bugs for you.&nbsp; You have the test case and the setup information the bug form needs.&nbsp; When I contact engineering, I can get them to look at things, but it doesn’t generate a trackable bug.&nbsp; While I believe this may be addressed in the next batch of widget fixes, just to make sure it stays on the radar, can you file a bug report and when you get the email confirmation, post the bugID back to this thread?

Thanks

Rob
