title: How to change color of svg image in android. Images are downloaded from web api
body: <p>I have an issue something like, I am downloading a image from web api and successfully set into imageview. I am unable to change the color of svg image that I downloaded.
  I tried tintColor in xml and setFilterColor() from .java file but nothing is work for me.
  Is there any solution please reply on this post.</p>
  
  <pre><code>public static void loadSvgWithColor(final Context context, String url, final int color, final ImageView target) {
      if (httpClient == null) {
          httpClient = new OkHttpClient.Builder()
                  .cache(new Cache(context.getCacheDir(), 5 * 1024 * 1014))
                  .build();
      }
      if (!url.equals("")) {
          Request request = new Request.Builder().url(url).build();
          httpClient.newCall(request).enqueue(new Callback() {
              @Override
              public void onFailure(Call call, IOException e) {
                  target.setImageResource(R.drawable.app_icon);
                  target.setColorFilter(color);
              }
  
              @Override
              public void onResponse(Call call, Response response) throws IOException {
                  InputStream stream = response.body().byteStream();
                  Sharp.loadInputStream(stream).into(target);
                  stream.close();
                  target.setColorFilter(color);
         }
          });
      } else {
          target.setImageResource(R.drawable.app_icon);
          target.setColorFilter(color);
      }
  }
  </code></pre>