Hi,
   I am new to android development and got a client requirement 
(Specifically related to android phone having version 5.0 or higher) where 
a user wants to switch his/her  "User Account"  from user  mode to guest 
mode programatically without rooting the device or without using the NFC 
method. 
   I have read few blogs related to this, which suggests the application to 
be installed normally on the device, then by using *"adb shell dpm 
set-device-owner"* command we can set the application as device owner. Then 
comes this method  "switchUser(ComponentName 
<https://developer.android.com/reference/android/content/ComponentName.html>
 admin, UserHandle 
<https://developer.android.com/reference/android/os/UserHandle.html> 
userHandle)" ,in program the functionality of the method is specified "Called 
by a device owner to switch the specified user to the foreground." called 
from my application to switch the account. But while calling this method 
 in my app and at the time of giving the administrative privileges to the 
app in command prompt I get an error "Error: Unknown admin: ComponentInfo{ 
the package name/ the classname including package name }" .
  My query, whether the error is related to the method, or  with the 
commands or is it related to the manifest file. It would be helpful if 
anyone gives some suggestion related to this.

Thank You,

 

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/aeec9369-e0e2-40e5-ab41-cfb8500c8781%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to