How to achieve this in an extension?

This is my code

Calendar instant = (Calendar) GetProperty(date,“Instant”);
String instants = String.valueOf(Dates.Year(instant));
SetProperty(title,“Text”,String.join(Dates.MonthName(instant) , " " , (instants)));

It gets compiled but it shows me error when i use the extension

This is what i want extension should set text to :point_down:

blocks (52)

for quick response, please ask this question on app inventor.

There’s no problem asking here.

The error shows that appybuider editor wasn’t able to get the class.

Prefer not using appybuider.


i managed to clear the error and the extension gets compiled, but it shows error when i use the extension

I have updated the first post

This is a completely different error, next time please make a new topic.

The error shows that you have some error in data type. You are trying to convert String into java.util.calendar type.

1 Like

but this topic is about achieving the blocks i want in an extension and so errors will change if i face more :slightly_smiling_face:

so what should i change… please guide me

What is GetProperty and SetProperty?

it is the same code for get property and set property from @yusufcihan extension

I don’t understand the purpose of this code. Why do you get and set property?
I am not able to help with such less information.

1 Like

You don’t need my extension’s source code for setting a property. And Dynamic Components extension has built for using it in the App Inventor project, not in the Java code. You can already create dynamic components and set properties in the Java without needing external code.

And App Inventor classes already have methods for setting a property.

You can use it in your code like: