List of usage examples for android.os UserManager getApplicationRestrictions
@WorkerThread
public Bundle getApplicationRestrictions(String packageName)
From source file:com.commonsware.android.profile.app.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); UserManager mgr = (UserManager) getSystemService(USER_SERVICE); Bundle restrictions = mgr.getApplicationRestrictions(getPackageName()); if (restrictions.keySet().size() > 0) { setContentView(R.layout.activity_main); RestrictionsFragment f = (RestrictionsFragment) getSupportFragmentManager() .findFragmentById(R.id.contents); f.showRestrictions(restrictions); } else {/*w w w . j a v a 2 s . co m*/ Toast.makeText(this, R.string.no_restrictions, Toast.LENGTH_LONG).show(); finish(); } }