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?sidharthanil
06/28/2017, 2:17 PMgildor
06/28/2017, 2:22 PMsidharthanil
06/28/2017, 2:34 PMvar productChangedListner: onProductsChangedListner
productChangedListner.updateProductList(products)
sidharthanil
06/28/2017, 2:35 PMgildor
06/28/2017, 2:38 PMgildor
06/28/2017, 2:38 PMsidharthanil
06/28/2017, 2:41 PMgildor
06/28/2017, 4:26 PMsidharthanil
06/29/2017, 5:26 AM