jfversluis / FilePicker-Plugin-for-Xamarin-and-Windows

FilePicker Plugin for Xamarin and Windows
MIT License
157 stars 80 forks source link

Just a small issue when used on Android #180

Closed thanhle7 closed 4 years ago

thanhle7 commented 4 years ago

Expected Behavior

N/A ps- I just want to thank Versluis and his team members for this wonderful plugin.

Actual Behavior

On Android, this plugin whenever opened will raise OnStop event on the main Activity. Anyone here knows how to detect whether OnStop is raised because the Activity has been obscured, not because it is about to be destroyed.

Specifications

vividos commented 4 years ago

FilePicker on Android uses another Activity to show the actual file picker, so it's normal for OnStop to be called. In the diagram in https://developer.android.com/guide/components/activities/activity-lifecycle you see that the lifecycle goes from OnPause to OnStop because the activity is no longer visible. If you have logic in OnStop that assumes it only gets called when the app is closed, you should maybe move that to OnDestroy. Otherwise, thank you for your thanks!

thanhle7 commented 4 years ago

Thanks @vividos . I will try using OnDestroy.

jfversluis commented 4 years ago

Closing this since this project will retire, please check out Xamarin.Essentials which now has a FilePicker based on this one.

thanhle7 commented 4 years ago

My appreciation to Versluis and his team. One of my app - TiShow (available on Google Play) which allows PowerPoint presentation using smartphone was developed using this wonderful plugin. Thank you!

jfversluis commented 4 years ago

Glad we could've played a small role in the success of your app! All the best luck to you!