Code example for Context

Methods: obtainStyledAttributes

0
    resources = Robolectric.application.getResources();
  } 
 
  @Test 
  public void getResources() throws Exception { 
    assertNotNull(context.obtainStyledAttributes(new int[]{}).getResources());
  } 
 
  @Test 
  public void getInt_shouldReturnDefaultValue() throws Exception { 
    assertThat(context.obtainStyledAttributes(new int[]{android.R.attr.alpha}).getInt(0, -1)).isEqualTo(-1);
  } 
 
  @Test 
  public void getInteger_shouldReturnDefaultValue() throws Exception { 
    assertThat(context.obtainStyledAttributes(new int[]{android.R.attr.alpha}).getInteger(0, -1)).isEqualTo(-1);
  } 
 
  @Test 
  public void getInt_withFlags_shouldReturnValue() throws Exception { 
Stop searching for code, let great code find you!  Add Codota to your java IDE