0

I'm trying to change the text. On Example in onActivityResult (), but I can not find a solution

@LayoutSpec
public class LaytourSpec {

    @OnCreateLayout
    static Component onCreateLayout(
            final ComponentContext c, @Prop(optional = true) String title) {
        return Text.create(c)
                .text("bla bla")
                .textSizeSp(18).build();
}
AskNilesh
  • 67,701
  • 16
  • 123
  • 163

1 Answers1

1

You need to create a new component and assign it into your LithoView through setComponent(), then you should see text changed.

@Override
void onCreate(Bundle savedInstanceState) {
  mLithoView = findViewById(...);
}

@Override
void onActivityResult(int requestCode, int resultCode, Intent data) {
   // Create a new component according to the result data.
   final Laytour laytour = Laytour.create(mComponentContext)...
   mLithoView.setComponent(laytour);
}
Jing-Wei Wu
  • 138
  • 1
  • 9