@Test public void shouldAssignStringToTextView() throws Exception { injectedActivity.onCreate(null); TextView injectedTextView = (TextView) injectedActivity.findViewById(R.id.injected_text_view); assertThat(injectedTextView.getText().toString(), equalTo("Roboguice Activity tested with Robolectric - December 8, 2010")); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.injected); DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.LONG, Locale.US); String formattedDate = dateFormat.format(date); injectedTextView.setText(caption + " - " + formattedDate); }
InjectedActivity extends RoboActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.injected); DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.LONG, Locale.US); String formattedDate = dateFormat.format(date); injectedTextView.setText(caption + " - " + formattedDate); } }
InjectedActivity extends RoboActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.injected); DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.LONG, Locale.US); String formattedDate = dateFormat.format(date); injectedTextView.setText(caption + " - " + formattedDate); }  }
InjectedActivity extends RoboActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.injected); DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.LONG, Locale.US); String formattedDate = dateFormat.format(date); injectedTextView.setText(caption + " - " + formattedDate); }   }
InjectedActivity extends RoboActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.injected); DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.LONG, Locale.US); String formattedDate = dateFormat.format(date); injectedTextView.setText(caption + " - " + formattedDate); }    }