Android: from string user id to int uid and vice versa 

Joined:
07/27/2010
Posts:
130

May 09, 2011 14:52:13    Last update: May 09, 2011 14:52:13
From string user id to int uid:
// import android.os.Process;
int uid = Process.getUidForName(userId);


From int uid to string user id:
// import android.content.pm.PackageManager;
PackageManager pm = getPackageManager();
String userId = pm.getNameForUid(uid);
Share |
| Comment  | Tags