title: Calling a method from overflowMenu?
body: <p>I have android code with a simple animation. Basically, on a tap down event, a button moves from top left to bottom right, while simultaneously enlarging. I have to methods, moveButton(); and moveButtonBack(); which are the methods that actually move the button using transitionManager. The problem is, when I call these methods from my </p>
  
  <pre><code> public boolean onOptionsItemSelected(MenuItem item) { }
  </code></pre>
  
  <p>method, the method doesn't get called. I know it is not the fault of my method, because those work fine on tap down events. Please help me figure out why my moveButton() and moveButtonBack() methods aren't being called. I have already watched and read several tutorials about overFlowMenu's. </p>
  
  <p>Here is the xml where I make the items for the menu:</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"             tools:context=".MainActivity"&gt;
  
  
  &lt;item android:id="@+id/action_settings"
      android:title="@string/action_settings"
      android:orderInCategory="1"
      app:showAsAction="never" /&gt;
  
  
  &lt;item
      android:id="@+id/MoveButtonExecution"
      android:orderInCategory = "2"
      app:showAsAction = "never"
      android:title = "Move button down!"
      /&gt;
  
  &lt;item
      android:id="@+id/MoveButtonBackExecution"
      android:orderInCategory = "3"
      app:showAsAction = "never"
      android:title = "Move button up!"
      /&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p>Here is the java code that should be calling the methods:</p>
  
  <pre><code> public boolean onOptionsItemSelected(MenuItem item) {
  
      int id = item.getItemId();
      Button myButton=(Button) findViewById(R.id.mybuttonid);
  
      switch (item.getItemId()) {
  
          case R.id.action_settings:
         item.setTitle("THIS DOES NOTHING");
              myButton.setText("No settings in animations");
              myButton.setBackgroundColor(Color.GREEN);
  
          case R.id.MoveButtonExecution:
  
              myButton.setText("moving");
              moveButton();
  
  
          case R.id.MoveButtonBackExecution:
              moveButtonBack();
              myButton.setText("movingback");
      }
  </code></pre>
  
  <p>If you need to see the methods moveButton and moveButtonBack, feel free to ask, but again, I am sure the methods are not the problem. Instead, I think the problem is in the java code where I <strong>call</strong> the methods. Thank you so much for your help, I really appreciate it. </p>