Java Code Examples for android.databinding.ObservableArrayList#add()

The following examples show how to use android.databinding.ObservableArrayList#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainActivity.java    From views-widgets-samples with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
    ObservableArrayList users = new ObservableArrayList();
    users.add(new User("George", "Mount"));
    binding.setUsers(users);
    binding.setHandler(new ButtonHandler(users));
}
 
Example 2
Source File: MainActivity.java    From android-ui-toolkit-demos with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
    ObservableArrayList users = new ObservableArrayList();
    users.add(new User("George", "Mount"));
    binding.setUsers(users);
    binding.setHandler(new ButtonHandler(users));
}