DJI-Mobile-SDK-Tutorials / Android-MediaManagerDemo

This demo is designed for you to learn how to use the MediaManager to interact with the file system on the SD card of the aircraft's camera. You can use it to preview photos, play videos, download or delete files and so on.
MIT License
25 stars 19 forks source link

Camera Stream not visible #2

Closed UmarDastgir closed 7 years ago

UmarDastgir commented 7 years ago

I recently tried installing the Media Manager Demo application and I have come across another bug. Upon going from the DefaultLayoutActivity (with the live camera stream) to the MainActivity (Media Manager), everything works fine. However, upon pressing the back button (in the MainActivity), the live stream of camera is no longer visible. This can be seen in the screenshots below.

Drone used: Phantom 3 Advanced Cell phone and Android Version: Samsung Galaxy S5, Lollipop 5.0 Android Studio Version 2.3.3

screenshot_2017-10-24-18-29-44 1 screenshot_2017-10-24-18-29-52 1

In the first picture, the live stream is clearly visible. When I press the button in the bottom right and then press back, the live stream is no longer visible (second screenshot).

oliverou commented 7 years ago

Hi @UmarDastgir , thanks for the feedbacks. We have addressed this issue and will fix it in the DJI Android UILibrary of the next release. Currently, we can provide a workaround for you:

Add the following code in MainActivity.java file to start the DefaultLayoutActivity:

    @Override
    public void finish() {
        Intent intent = new Intent(this, DefaultLayoutActivity.class);
        startActivity(intent);
        super.finish();
    }

In the DefaultLayoutActivity.java file, add the following code below startActivity(intent); in the onClick() method to close the activity when the button is clicked:

     finish();
UmarDastgir commented 7 years ago

Works perfectly. Thanks.