skip to Main Content

How can I access a JSON file in the ViewModel class?

I'm trying to load a RecyclerView with JSON data in a local file located in 'assets'. Activity: class RecipesActivity : AppCompatActivity(), RecipeAdapter.RecipeItemListener { private lateinit var binding : ActivityRecipesBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityRecipesBinding.inflate(layoutInflater) setContentView(binding.root) setSupportActionBar(binding.mainToolBar.toolbar)…

VIEW QUESTION
Back To Top
Search