Error in creating an extension

Error
message.txt (3.0 KB)
Code

        @SimpleProperty(description = "")
        public void TextColor(String hexColor) {
        Menu menu = popup.getMenu();
        int menuSize = menu.size() - 1;
        for (int index = 0; index <= menuSize; index++) {
            MenuItem item = menu.getItem(index);
            SpannableString s = new SpannableString(item.getTitle().toString());
            s.setSpan(new ForegroundColorSpan(Color.parseColor(hexColor)), 0, s.length(), 0);
            item.setTitle(s);
        }
    }

have you imported this?

import android.text.SpannableString;


I don't think there is a problem with the code I made, please show me all the codes

I have imported this wait I send you my whole code

s.setSpan(new ForegroundColorSpan(Color.parseColor(hexColor)), 0, s.length, 0);
1 Like

This is my whole code
https://res.cloudinary.com/df3qkgfyp/raw/upload/v1629431329/Popup_ts7k04.java

Same code I used

No. Litle diferent.

s.length 

vs

s.length()
1 Like

Where are you writing you code? Not in a IDE like Eclipse?

I write in appy builder code editor

Thank you @Patryk_F

Strongly recommend the aixc and eclipse for extention developing:
https://www.kevinkun.cn/aixc
please translate by google.

Hey @Patryk_F again I face same error after removing ()

Help me I want to compile this fast

My mistake. I took a wrong look somewhere. This code compiles for me:
Popup.txt (3.7 KB)

1 Like

@Faraz_Firoz try to compile with https://ide.niotron.com/

1 Like

Don't use it. This is an old and outdated environment.

3 Likes

Ok friends I try I niotron ide

1 Like

Same error in niotron ide
Please see code from start to end and tell me error

Check my code which I put in the txt file. For me, this code compiles correctly in the AI2 source environment. In Niotron too.

Please give that code agian