Display default image and replace that image with the uploaded image in android
<p>I want to upload an image to particular id in server from my app and display it immediately getting a toast message as "uploaded".If there is no image exists for that particular id then I want to display some default image and later I want to replace it with the uploaded image.how can I do this?</p>

<pre><code> @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_student_details);
            {
            String IMAGE_URL = "http://xxx.xxx.xx.x/mobile_app/" + img_path + "/" + img_name;
            new DownloadImageTask((ImageView) findViewById(R.id.ProfilePicIV))
                    .execute(IMAGE_URL);
            }


    public void onResume()
        {  // After a pause OR at startup
            super.onResume();
            getIntent();
            String auid_num = auid_s.getText().toString();
            String imei_num = imei_s.getText().toString();
            String img_name = getIntent().getStringExtra("img_name");
            String img_path = getIntent().getStringExtra("img_path");
            //Refresh your stuff here
            SendDataToServer(auid_num, imei_num);
           String IMAGE_URL = "http://xxx.xxx.xx.x/mobile_app/" + img_path + "/" + img_name;
          new DownloadImageTask((ImageView) findViewById(R.id.ProfilePicIV))
                    .execute(IMAGE_URL);

        }

  private class DownloadImageTask extends AsyncTask&lt;String, Void, Bitmap&gt; {
        ImageView bmImage;

        public DownloadImageTask(ImageView bmImage) {
            this.bmImage = bmImage;
        }

        protected Bitmap doInBackground(String... urls) {
            String urldisplay = urls[0];
            Bitmap mIcon11 = null;
            try {
                InputStream in = new java.net.URL(urldisplay).openStream();
                mIcon11 = BitmapFactory.decodeStream(in);
            } catch (Exception e) {
                Log.e("Error", e.getMessage());
                e.printStackTrace();
            }
            return mIcon11;
        }

        protected void onPostExecute(Bitmap result) {
            bmImage.setImageBitmap(result);
        }
    }

xml:
&lt;ImageView
                android:id="@+id/ProfilePicIV"
                android:layout_width="120dp"
                android:layout_height="120dp"
                android:background="@drawable/default_image"
                android:scaleType="fitXY" /&gt;
</code></pre>