public class MainActivity extends AppCompatActivity {
@ Override
Protected void onCreate (Bundle savedInstanceState) {
Super. OnCreate (savedInstanceState);
ActivityMainBinding binding=DataBindingUtil. The setContentView (this, R.l ayout. Activity_main);
The Config Config=new Config ();
Binding. SetCfg (config);
}
}
public class Config extends BaseObservable {
Public ObservableInt stopTimeBegin=new ObservableInt ();
Public Config () {
}
@ InverseMethod (" stringToi ")
Public static String itoString (ObservableInt I) {
Return a String. The valueOf (i.g et ());
}
Public static ObservableInt stringToi (String STR) {
Return new ObservableInt (Integer. The valueOf (STR));
}
}
Type="com. Wind. Databinding. Config"/& gt;
Android: layout_height="match_parent" & gt;
Android: layout_width="match_parent"
Android: text='@={CFG. ItoString (CFG) stopTimeBegin)}'
Android: layout_height="match_parent" & gt;
How not to do what type conversion, there is no problem..
CodePudding user response:
Have been a reasonCFG. ItoString
It should be
Config. ItoString