Black Screen After Selecting a Photo


#1

Hi guys, I am doing an app that selects a photo from the gallery and displays it on the UI and at the same time converting the photo to pdf. My problem is after I select a photo it then turns back to the UI but between that process it will display a “Black Screen” for about 5-10 seconds before the UI shows up.

Is there a way to detect that or replace that black screen to a loading or processing page? Or just to show a message that the photo is being processed?

Thanks guys.


#2

I’m guessing whatever code you are running after selecting a photo, may be for showing it on UI / converting to PDF eats a lot of memory and slows down main thread. May be you can debug that by commenting out part of code and see if black screen is still there.


#3

Add a 1 second timeout before starting pdf conversion.
And also use nativescript loading indicator to indicate the user that you are doing something.


#4

Thank you guys I already resolved it by moving the function that converts it to PDF to the actual saving of the form. I also added a loading indicator :slight_smile: