title: Robolectric : findViewById gives view, but performClick() returns false
body: <p>I'm using Robolectric to perform unit test on an android app. 
  The problem is simple : i can get my Button using findViewById, but calling on it either <code>performClick()</code>method or <code>Robolectric.clickOn()</code> will return false. </p>
  
  <p>However the button works perfectly, tested through the app or with Robotium unit tests...</p>
  
  <p>here is the test code that doesn't pass : </p>
  
  <pre><code>@RunWith(RobolectricTestRunner.class)    
  public class RegisterActivityTest {
  
  private MainActivity mainActivity;
  private LoginActivity loginActivity;
  
  @Before
  public void setUp(){
      mainActivity=new MainActivity();
      mainActivity.onCreate(null);
      mainActivity.setContentView(R.layout.main);
    }
  
  @Test
  public void testButton() throws Exception {
      Button buttonPayment=(Button)mainActivity.findViewById(R.id.btn_payment);
      assertNotNull(buttonPayment); // will pass test ( ---&gt; the view is a button and exists ) 
      assertTrue(buttonPayment.performClick()); // raise AssertionError
      assertTrue(Robolectric.clickOn(buttonPayment)); // raise AssertionError as well
    }
  }
  </code></pre>
  
  <p>Thanks everybody.</p>
  
  <p>Paul </p>