gitawego / cordova-screenshot

screenshot plugin for cordova/phonegap
Other
211 stars 168 forks source link

Take screenshot of user home screen #35

Open wscoder opened 9 years ago

wscoder commented 9 years ago

Hi, I'm trying to modify the Screenshoot.java to capture the user home screen instead of appView screen when the app runs in background.

After some research, I have tried to change the code: View view = webView.getRootView();

to code: View view = getWindow().getDecorView().getRootView();

but it gives an error that method getWindow() can not found even after: import android.view.Window;

Then I changed the code to: View view = cordova.getActivity().getWindow().getDecorView().getRootView();

The above code compiles but still captures the app screen even if it's running in background and not the user home screen.

Can you pls, help me to figure out how to get the "view" of user home screen instead of app screen?

Regards.

ghost commented 6 years ago

@wscoder were you able to resolve your issue?