use of android.os.Bundle in project cw-omnibus by commonsguy.
the class RestrictionEntriesReceiver method onReceive.
@Override
public void onReceive(Context ctxt, Intent intent) {
Bundle current = (Bundle) intent.getParcelableExtra(Intent.EXTRA_RESTRICTIONS_BUNDLE);
ArrayList<RestrictionEntry> restrictions = new ArrayList<RestrictionEntry>();
restrictions.add(buildBooleanRestriction(ctxt, current));
restrictions.add(buildChoiceRestriction(ctxt, current));
restrictions.add(buildMultiSelectRestriction(ctxt, current));
Bundle result = new Bundle();
result.putParcelableArrayList(Intent.EXTRA_RESTRICTIONS_LIST, restrictions);
setResultExtras(result);
}
use of android.os.Bundle in project cw-omnibus by commonsguy.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
UserManager mgr = (UserManager) getSystemService(USER_SERVICE);
Bundle restrictions = mgr.getUserRestrictions();
if (restrictions.keySet().size() > 0) {
setContentView(R.layout.activity_main);
RestrictionsFragment f = (RestrictionsFragment) getFragmentManager().findFragmentById(R.id.contents);
f.showRestrictions(restrictions);
} else {
Toast.makeText(this, R.string.no_restrictions, Toast.LENGTH_LONG).show();
finish();
}
}
use of android.os.Bundle in project cw-omnibus by commonsguy.
the class MainActivity method onCreate.
@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) getFragmentManager().findFragmentById(R.id.contents);
f.showRestrictions(restrictions);
} else {
Toast.makeText(this, R.string.no_restrictions, Toast.LENGTH_LONG).show();
finish();
}
}
use of android.os.Bundle in project cucumber-jvm by cucumber.
the class ArgumentsTest method supports_features_as_direct_bundle_argument.
@Test
public void supports_features_as_direct_bundle_argument() {
// given
final Bundle bundle = new Bundle();
bundle.putString("features", "someFeature");
final Arguments arguments = new Arguments(bundle);
// when
final String cucumberOptions = arguments.getCucumberOptions();
// then
// TODO does this space makes sense?
assertThat(cucumberOptions, is(" someFeature"));
}
use of android.os.Bundle in project cucumber-jvm by cucumber.
the class ArgumentsTest method handles_empty_bundle_gracefully.
@Test
public void handles_empty_bundle_gracefully() {
// given
final Arguments arguments = new Arguments(new Bundle());
// when
final String cucumberOptions = arguments.getCucumberOptions();
// then
assertThat(cucumberOptions, is(""));
}
Aggregations