title: Android - Disable the Onclick
body: <p>I am new to android. I get the code from internet which is below</p>
  
  <pre><code>View.OnClickListener loadImage = new View.OnClickListener(){
          public void onClick(View view) {
  
              loadImage(imageLocation);
  
              }
       };
  
       void loadImage(String image_location){
  
            URL imageURL = null;
  
            try {
                imageURL = new URL(image_location);
              } 
  
            catch (MalformedURLException e) {
                e.printStackTrace();
              }
  
            try {
                HttpURLConnection connection= (HttpURLConnection)imageURL.openConnection();
                connection.setDoInput(true);
                connection.connect();
                InputStream inputStream = connection.getInputStream();
  
                bitmap = BitmapFactory.decodeStream(inputStream);//Convert to bitmap
                Bitmap drawableBitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true);
                drawView.setCanvasBitmap(drawableBitmap);
  
            }
            catch (IOException e) {
  
                 e.printStackTrace();
            }
       }
  </code></pre>
  
  <p>This method will load the image from URL when the button is clicked. It is worked but I need to load the image from URL when activity is launch. </p>
  
  <p>How should I modify the code to remove the onClick ? Kindly look for helps. Thanks =)</p>