package Ġlink . stand en . m ichael . phones aver . activity Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . support . v 7 . app . AppCompatActivity Ċ import Ġandroid . widget . ListView Ċ import Ġandroid . os . Parcelable Ċ Ċ /** Ċ Ġ* ĠAn Ġactivity Ġfor Ġselecting Ġa Ġfolder Ġin Ġthe Ġfile Ġsystem . Ċ Ġ*/ Ċ abstract Ġclass ĠList Activity Ġ: ĠAppCompatActivity () Ġ{ ĊĊ ĉ comp anion Ġobject Ġ{ Ċĉ ĉ const Ġval ĠLIST _ STATE Ġ= Ġ" list State " Ċ ĉ } ĊĊ ĉ private Ġvar Ġlist State : ĠParcel able ? Ġ= Ġnull ĊĊ ĉ override Ġfun Ġon Resume () Ġ{ Ċĉ ĉ super . on Resume () ĊĊĉ ĉ // ĠRestore Ġthe Ġlist Ġview Ġscroll Ġlocation Ċĉ ĉ list State ?. let Ġ{ ĠfindViewById < ListView >( android . R . id . list ). on Restore InstanceState ( list State ) Ġ} Ċĉ ĉ list State Ġ= Ġnull Ċ ĉ } ĊĊ ĉ /** Ċĉ Ġ* ĠLoad Ġlist Ġview Ġscroll Ġposition Ċĉ Ġ*/ Ċ ĉ override Ġfun Ġon Restore InstanceState ( savedInstanceState : ĠBundle ) Ġ{ Ċĉ ĉ super . on Restore InstanceState ( savedInstanceState ) Ċĉ ĉ list State Ġ= ĠsavedInstanceState . get Parcelable ( LIST _ STATE ) Ċ ĉ } ĊĊ ĉ /** Ċĉ Ġ* ĠSave Ġlist Ġview Ġscroll Ġposition Ċĉ Ġ*/ Ċ ĉ override Ġfun Ġon Save InstanceState ( out State : ĠBundle ) Ġ{ Ċĉ ĉ super . on Save InstanceState ( out State ) Ċĉ ĉ list State Ġ= ĠfindViewById < ListView >( android . R . id . list ). on Save InstanceState () Ċĉ ĉ out State . put Parcelable ( LIST _ STATE , Ġlist State ) Ċ ĉ } Ċ Ċ } Ċ