title: Using an SVG as a background drawable in Android
body: <p>I'm trying to use an SVG image (created using Inkscape and saved as plain SVG) as a background for my application. I'm trying to do this using the <code>svg-android</code> library. I have a file called <code>background.svg</code> in <code>res/raw</code>. My code looks like this:</p>
  
  <pre><code>SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.background);
  Drawable pictureDrawable = svg.createPictureDrawable();
  Bitmap bitmap = Bitmap.createBitmap(pictureDrawable.getIntrinsicWidth(), pictureDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
  BitmapDrawable bitmapDrawable = new BitmapDrawable(bitmap);
  
  LinearLayout backgroundLayout = (LinearLayout) findViewById(R.id.background);
  bitmapDrawable.setTileModeX(Shader.TileMode.REPEAT);
  backgroundLayout.setBackgroundDrawable(bitmapDrawable);
  </code></pre>
  
  <p>However when my application starts up, nothing shows up as the background (other than the background color from the layout). My layout xml file is as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:background="#aacceeff"
      &gt;
  
   &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/background"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
      &gt;
   &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>It appears that there is a problem with my SVG. It might be due to the fact that all features are not supported.</p>