package Ġcom . v eng ates hm . recipes pl aza . ui . activities Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . activity . view Models Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġcom . v eng ates hm . recipes pl aza . R Ċ import Ġcom . v eng ates hm . recipes pl aza . ui . fragments . Me al List Fragment Ċ import Ġcom . v eng ates hm . recipes pl aza . ui . view models . Recipe ViewModel Ċ import Ġcom . v eng ates hm . recipes pl aza . utils . KEY _ RE CI PE _ CATEGORY _ ID Ċ Ċ class ĠRe cipes Activity Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġrecipe ViewModel : ĠRecipe ViewModel Ġby Ġview Models () ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ meal _ landing ) ĊĊĠĠĠĠĠĠĠ Ġintent ?. also Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġcategory Ġ= Ġit . getString Extra ( KEY _ RE CI PE _ CATEGORY _ ID ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( category . isNull OrEmpty ()) Ġreturn @ also ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġrecipe ViewModel . setSelected Category ( category ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsupport FragmentManager . beginTransaction () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. replace ( R . id . meal Landing Fragment Container , ĠMe al List Fragment . newInstance ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. commit Allow ing State Loss () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }