package Ġcom . faf ad iate ch . news cout . view model Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ Ċ class ĠViewModel Provider Factory (): ViewModel Provider . Factory Ġ{ ĊĊĠĠĠ Ġlateinit Ġvar Ġm Application : Application ĊĠĠĠ Ġvar Ġm Params : Int = 0 ĊĊĠĠĠ Ġconstructor ( application : ĠApplication , param : Int ): this (){ ĊĠĠĠĠĠĠĠ Ġm Application Ġ= Ġapplication ĊĠĠĠĠĠĠĠ Ġm Params Ġ= Ġparam ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġ< T Ġ: ĠViewModel ?> Ġcreate ( model Class : ĠClass < T >): ĠT Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġ ĠFetch Data Api ViewModel ( m Application , m Params ) Ġ Ġas ĠT ĊĠĠĠ Ġ} Ċ }