trleithoff
Lurker
Hi, I am trying to change the lock screen background image but I cannot figure out how to view this in the android studio emulator. When the emulator first loads up it shows the lock screen for a second then it goes straight to the home screen then finally my app. I click the on/off button twice but it goes to the camera instead. If the camera is set to be the lock screen is there a way I can change this? I just want to be able to test whether or not my code to set the lock screen image is working or not. The type of phone that my emulator is set up to use is a Galaxy Nexus API 25 (Android 7.1.1) and I am getting no errors when I run.
Here is a video of the emulator loading up:
And here is a video of my trying to get to the lock screen:
FYI: here is the code I wrote to try and set the lock screen image: (I don't know if it works or not though as I'm not able to get back to the lock screen after leaving my app)
I also set the screen lock to swipe under security in the settings. I tried setting up a Lock SIM Card PIN to try and force the lock screen to wait for me to enter my pin but I cannot set it. It keeps saying operation failed.
Any help would be greatly appreciated. Thanks.
Here is a video of the emulator loading up:
And here is a video of my trying to get to the lock screen:
FYI: here is the code I wrote to try and set the lock screen image: (I don't know if it works or not though as I'm not able to get back to the lock screen after leaving my app)
Code:
@TargetApi(24)
@JavascriptInterface
public void changeLockScreenBg() {
WallpaperManager lockscreen = WallpaperManager.getInstance(getActivity().getApplicationContext());
InputStream is = getResources().openRawResource(+ R.drawable.fantasytreehouse);
try {
lockscreen.setStream(is, null, true, WallpaperManager.FLAG_LOCK);
} catch (IOException e) {
e.printStackTrace();
System.out.println("lockscreen error: " + e);
}
}
I also set the screen lock to swipe under security in the settings. I tried setting up a Lock SIM Card PIN to try and force the lock screen to wait for me to enter my pin but I cannot set it. It keeps saying operation failed.
Any help would be greatly appreciated. Thanks.
Attachments
Last edited: