Is there a way for the application to know if the terminal is operating in Device owner mode?
android
Hello
By implementing the sample code below in the application, you can determine whether the application is a device downer or not.
Create an instance of DevicePolicyManager and use the isDeviceOwnerApp function
Determine if it is the device owner.
Below is the sample code.
//import android.app.admin.DevicePolicyManager;
// import android.widget.Toast;
DevicePolicyManager=(DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
if(!manager.isDeviceOwnerApp(getApplicationContext().getPackageName())))
{
Toast.makeText(MainActivity.this, "device owner is not configured", Toast.LENGTH_LONG).show();
}
© 2024 OneMinuteCode. All rights reserved.