title: How to make a Button randomly Move
body: <p>I have a question about how to make a button randomly move every second.</p>
  <p>The black tiles are a button:</p>
  <p><a href="https://i.stack.imgur.com/YqYcS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YqYcS.png" alt="enter image description here" /></a></p>
  <p>So I want to make it move randomly in every second or more fast.</p>
  <p><a href="https://i.stack.imgur.com/pFjCY.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pFjCY.gif" alt="enter image description here" /></a></p>
  <p>this is my xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;fill_parent&quot;
      android:background=&quot;@drawable/backgroundblank&quot; &gt;
                    &lt;Button
                      android:id=&quot;@+id/Button01&quot;
                      android:layout_width=&quot;wrap_content&quot;
                      android:layout_height=&quot;wrap_content&quot;
                      android:background=&quot;@drawable/black1&quot; /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  <p>this is the code</p>
  <pre><code>public class tested extends Activity {
  
  Button buttonblack;
  int score=0;
  
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      this.requestWindowFeature(Window.FEATURE_NO_TITLE);
      getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
      WindowManager.LayoutParams.FLAG_FULLSCREEN);
      setContentView(R.layout.tested);
  
  
      buttonblack = (Button)findViewById(R.id.black1);
      buttonblack.setOnClickListener(new View.OnClickListener() {
  
                public void onClick(View v){
                //score+10(i dont know how to make score +10 if the button clicked)
                //if the button clicked
                //Do some logic here
                                           }                
              });
  
  if (score = 100){
           //the speed of move are increase more fast
                  }
      
  }
  </code></pre>
  <p>anyone can help me?</p>