Screen blacks out while coming back to corona runtime (lua) from an activity

Hi,

I would like to show the event calendar in out application. So I am using corona enterprise to access the event view from lua. Here is the code:-

        android.os.Handler handler = fParentActivity.getHandler();

        if (handler != null) {

            handler.post( new Runnable() {

                public void run() {

                    if (null == fParentActivity) return;

                    Intent calIntent = new Intent(Intent.ACTION_INSERT);                    

                    calIntent.setData(Uri.parse(getCalendarUriBase()+“events”)); 

                    calIntent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME,Long.valueOf(startDate));

                    calIntent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME,Long.valueOf(endDate));

                    fParentActivity.startActivity(calIntent);                

                }

            } );

        }

 The issue is after i press save button, it is supposed to come back to my immediately, instead of that the screen blacks out from 1 sec and then my app will be shown. For the user it looks bad. I have other UI activities called from lua and all of them have the same issue.

Could you guys please give me a solution for this.

regards,

Karim.

On Android, all OpenGL textures get dumped from memory when switching activities.  This is imposed by the operating system, and since some low-end Android devices are memory starved, it’s best to let Android do this to prevent the OS from destroying the Corona activity due to low memory.  But because of this… Corona has to reload all textures back into OpenGL when the Corona activity gets resumed.  If you have a lot of image file references in your OpenGL scene, then this can account for the 1 second delay.  You can reduce the load time by using less image files.  For example, use ImageSheets to store multiple images/sprites to reduce the number of files that get loaded, because typically it is file IO that is the bottleneck in this case.

Info about image sheets can be found here…

http://docs.coronalabs.com/api/type/ImageSheet/index.html

On Android, all OpenGL textures get dumped from memory when switching activities.  This is imposed by the operating system, and since some low-end Android devices are memory starved, it’s best to let Android do this to prevent the OS from destroying the Corona activity due to low memory.  But because of this… Corona has to reload all textures back into OpenGL when the Corona activity gets resumed.  If you have a lot of image file references in your OpenGL scene, then this can account for the 1 second delay.  You can reduce the load time by using less image files.  For example, use ImageSheets to store multiple images/sprites to reduce the number of files that get loaded, because typically it is file IO that is the bottleneck in this case.

Info about image sheets can be found here…

http://docs.coronalabs.com/api/type/ImageSheet/index.html