@EActivity(R.layout.data_layout)
public class MyActivity extendsActivity
{
@Bean MyEbean bean;
@AfterViews
public void setupView()
{
bean.loadData("Test name");
}
}
@EBean public class MyEbean
{
@RootContext context;
@ViewById(R.id.name_field)
TextView nameField;
public void loadData(String name)
{
nameField.setText(name);
}
}
लोडडाटा() में "nameField" शून्य के अंदर काम करने के लिए @ViewById नहीं मिल सकता है। एक ही समय मैं loadData अंदर ऐसा करते हैं() पर@EBean
nameField = (TextView)((Activity)context).findViewById(R.id.name_field); it's all good. So the view isdefinitely there. Also if I call this method from a retrofit callback
(अर्थात के बाद एक देरी) "नाम" ऑटो भर जाती है।
मैं एंड्रॉयड एनोटेशन उपयोग कर रहा हूँ 3.3.2