Reputation: 94
I must use this code on my android Project but I can't find it in Android.
I google it and find there is "android.databind.ObservableArrayList" but in Android Studio I can't find it.
private ObservableList<Urunler> data = FXCollections.observableArrayList();
Upvotes: 1
Views: 5446
Reputation: 215
To use ObservableArrayList
you need to download the library from the Support repository in the Android SDK manager.
To configure your app to use data binding, add the dataBinding
element to your build.gradle file in the app module.
Use the following code snippet to configure data binding:
dataBinding {
enabled = true
}
after that you will be able to use ObservableArrayList
in Android Studio
Upvotes: 3
Reputation: 11018
The code mentioned uses JavaFx 8 API's. Make sure your IDE is using java 8 JavaFX API if not include them or update your JDK. Get a copy of JDK from the official website.
Read FxCollections docs here
Read ObservableList docs here
Upvotes: 0