[Android] Save video pause status with a flag

Jean-Baptiste Kempf jb at videolan.org
Tue Jan 6 09:37:11 CET 2015


On 05 Jan, Edward Wang wrote :
> +            // Paused flag
> +            boolean wasPaused = mSettings.getBoolean(PreferencesActivity.VIDEO_PAUSED, false);
> +            if(wasPaused) {
> +                Log.d(TAG, "Video was previously paused, resuming in paused mode");
> +                mHandler.postDelayed(new Runnable() {
> +                    @Override
> +                    public void run() {
> +                        mLibVLC.pause();
> +                    }}, 500);
> +            }

Sorry, but this is overly ugly.

What if the video takes more than 500ms to open? What if it takes less?

With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device


More information about the Android mailing list