package Ġcom . team 0 3 . cock tail recipes app Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . SharedPreferences Ċ import Ġandroid . content . res . Configuration Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . os . Persist able Bundle Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġjava . util .* Ċ Ċ abstract Ġclass ĠSharedPreferences Activity Ġ: ĠAppCompatActivity () Ġ{ ĊĠĠĠ Ġlateinit Ġvar Ġshared : ĠSharedPreferences ĊĠĠĠ Ġlateinit Ġvar Ġshared _ editor : ĠSharedPreferences . Editor ĊĠĠĠ Ġlateinit Ġvar Ġdifficulty Array : ĠArray < String > ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġshared Ġ= Ġget SharedPreferences (" Settings ", ĠContext . MODE _ PRIVATE ) ĊĠĠĠĠĠĠĠ Ġshared _ editor = Ġget SharedPreferences (" Settings ", ĠContext . MODE _ PRIVATE ). edit () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonStart () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onStart () ĊĠĠĠĠĠĠĠ Ġdifficulty Array Ġ= ĠarrayOf ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġresources . getString ( R . string . difficulty _ very _ easy ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġresources . getString ( R . string . difficulty _ easy ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġresources . getString ( R . string . difficulty _ medium ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġresources . getString ( R . string . difficulty _ hard ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġresources . getString ( R . string . difficulty _ very _ hard ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Recipe Diff ic ut ly ( difficulty : ĠInt ) Ġ: ĠString ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġdifficulty Array [ difficulty - 1 ] ĊĠĠĠ Ġ} Ċ }