sidharthanil
06/28/2017, 1:42 PMgildor
06/28/2017, 1:48 PMsidharthanil
06/28/2017, 2:06 PMinterface onProductsChangedListner{
fun updateProductList(products:List<Product>)
}
and implemented the same in a fragment
class GalleryFragment: Fragment(),MainActivity.onProductsChangedListner {
override fun updateProductList(products: List<Product>) {
this.products = products
galleryAdapter.changeDataset(products)
}
How do i call the interface methods from main activity?gildor
06/28/2017, 2:22 PMsidharthanil
06/28/2017, 2:34 PMvar productChangedListner: onProductsChangedListner
productChangedListner.updateProductList(products)
gildor
06/28/2017, 2:38 PMsidharthanil
06/28/2017, 2:41 PMgildor
06/28/2017, 4:26 PMsidharthanil
06/29/2017, 5:26 AM