title: Android Development: Simplest collision detection?
body: <p>I'm trying to accomplish collision detection. Im not using OpenGl, I'm using canvas/surfaceview.</p>
  
  <p>I have 2 bitmaps.
  This is what ive come up to so far:</p>
  
  <pre><code>public boolean inBounds(int x2,int y2, int x,int y,int width,int height){
      if(x2 &gt; x &amp;&amp; x2 &lt; x + width -1 &amp;&amp; y2 &gt; y &amp;&amp; y2 &lt; y + height -1){
          return true;
      }
       return false;
  
         }
  </code></pre>
  
  <p>This does run but it only detects collision if x2 and y2's corner is inside the other object.</p>
  
  <p>So how do I improve my collision detection?</p>
  
  <p><img src="https://i.stack.imgur.com/IWRSd.png" alt="enter image description here"></p>
  
  <p>This image I found on the web should detect collision in my program.</p>
  
  <p>//Simon</p>