title: Android: Multi-gradient shapes
body: <p>Hello I try to create a drawable XML file that has a multi gradient shapes.</p>
  
  <p>I want something like this, top left is red, top right is yellow 
  and bottom is blue as in 3 zones.
  <img src="https://i.stack.imgur.com/OiQ6I.png" alt="enter image description here"></p>
  
  <p>The close thing I can find that take about this is a other questions on here.
  <a href="https://stackoverflow.com/questions/4381033/multi-gradient-shapes">Multi-gradient shapes</a>
  The user has fix it by use <code>layer-list</code>. I has try this but this will not work,
  What I can understand I will do this but not work.
  ( This is the <code>button_real_world.xml</code> file ) </p>
  
  <pre><code>&lt;layer-list
      xmlns:android="http://schemas.android.com/apk/res/android"
  &gt;
      &lt;item&gt;
          &lt;shape
              xmlns:android="http://schemas.android.com/apk/res/android"
              android:shape="rectangle"
          &gt;
              &lt;stroke android:width="4dp" android:color="#FFFF7700" /&gt; 
              &lt;padding android:left="7dp" android:top="7dp" 
                       android:right="7dp" android:bottom="7dp" /&gt; 
              &lt;corners android:radius="15dp" /&gt; 
  
              &lt;gradient
                  android:angle="45"
                  android:startColor="#FF63a34a"
                  android:endColor="#FF477b36"
                  android:type="linear"
                  /&gt;    
          &lt;/shape&gt;
      &lt;/item&gt;
      &lt;item&gt;
          &lt;shape
              xmlns:android="http://schemas.android.com/apk/res/android"
              android:shape="rectangle"
          &gt;
              &lt;stroke android:width="4dp" android:color="#FFFF7700" /&gt; 
              &lt;padding android:left="7dp" android:top="7dp" 
                       android:right="7dp" android:bottom="7dp" /&gt; 
              &lt;corners android:radius="15dp" /&gt; 
              &lt;gradient
                  android:angle="250"
                  android:startColor="#FF63a34a"
                  android:endColor="#ff477b36"
                  android:type="linear"
                  /&gt;    
          &lt;/shape&gt;            
      &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>But this will only get me a Run time error, ( Run in Emulator, Windows )</p>
  
  <pre><code>W/dalvikvm( 1075): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
  E/AndroidRuntime( 1075): Uncaught handler: thread main exiting due to uncaught exception
  E/AndroidRuntime( 1075): android.view.InflateException: Binary XML file line #8: Error inflating class &lt;unknown&gt;
  E/AndroidRuntime( 1075):        at android.view.LayoutInflater.createView(LayoutInflater.java:513)
  E/AndroidRuntime( 1075):        at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
  E/AndroidRuntime( 1075):        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
  E/AndroidRuntime( 1075):        at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
  E/AndroidRuntime( 1075):        at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
  E/AndroidRuntime( 1075):        at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
  E/AndroidRuntime( 1075):        at se.evigfilosofi.transportmanagement.util.ui.AdvancedArrayAdapter.createViewFromResource(AdvancedArrayAdapter.java:224)
  E/AndroidRuntime( 1075):        at se.evigfilosofi.transportmanagement.util.ui.AdvancedArrayAdapter.getView(AdvancedArrayAdapter.java:213)
  E/AndroidRuntime( 1075):        at android.widget.AbsListView.obtainView(AbsListView.java:1274)
  E/AndroidRuntime( 1075):        at android.widget.ListView.makeAndAddView(ListView.java:1668)
  E/AndroidRuntime( 1075):        at android.widget.ListView.fillDown(ListView.java:637)
  E/AndroidRuntime( 1075):        at android.widget.ListView.fillFromTop(ListView.java:694)
  E/AndroidRuntime( 1075):        at android.widget.ListView.layoutChildren(ListView.java:1521)
  E/AndroidRuntime( 1075):        at android.widget.AbsListView.onLayout(AbsListView.java:1113)
  E/AndroidRuntime( 1075):        at android.view.View.layout(View.java:6830)
  E/AndroidRuntime( 1075):        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
  E/AndroidRuntime( 1075):        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
  E/AndroidRuntime( 1075):        at android.widget.LinearLayout.onLayout(LinearLayout.java:918)
  E/AndroidRuntime( 1075):        at android.view.View.layout(View.java:6830)
  E/AndroidRuntime( 1075):        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
  E/AndroidRuntime( 1075):        at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1108)
  E/AndroidRuntime( 1075):        at android.widget.LinearLayout.onLayout(LinearLayout.java:920)
  E/AndroidRuntime( 1075):        at android.view.View.layout(View.java:6830)
  E/AndroidRuntime( 1075):        at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
  E/AndroidRuntime( 1075):        at android.view.View.layout(View.java:6830)
  E/AndroidRuntime( 1075):        at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1388)
  E/AndroidRuntime( 1075):        at android.view.View.layout(View.java:6830)
  E/AndroidRuntime( 1075):        at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
  E/AndroidRuntime( 1075):        at android.view.View.layout(View.java:6830)
  E/AndroidRuntime( 1075):        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
  E/AndroidRuntime( 1075):        at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1108)
  E/AndroidRuntime( 1075):        at android.widget.LinearLayout.onLayout(LinearLayout.java:920)
  E/AndroidRuntime( 1075):        at android.view.View.layout(View.java:6830)
  E/AndroidRuntime( 1075):        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
  E/AndroidRuntime( 1075):        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
  E/AndroidRuntime( 1075):        at android.widget.LinearLayout.onLayout(LinearLayout.java:918)
  E/AndroidRuntime( 1075):        at android.view.View.layout(View.java:6830)
  E/AndroidRuntime( 1075):        at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
  E/AndroidRuntime( 1075):        at android.view.View.layout(View.java:6830)
  E/AndroidRuntime( 1075):        at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
  E/AndroidRuntime( 1075):        at android.view.View.layout(View.java:6830)
  E/AndroidRuntime( 1075):        at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
  E/AndroidRuntime( 1075):        at android.view.View.layout(View.java:6830)
  E/AndroidRuntime( 1075):        at android.view.ViewRoot.performTraversals(ViewRoot.java:996)
  E/AndroidRuntime( 1075):        at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
  E/AndroidRuntime( 1075):        at android.os.Handler.dispatchMessage(Handler.java:99)
  E/AndroidRuntime( 1075):        at android.os.Looper.loop(Looper.java:123)
  E/AndroidRuntime( 1075):        at android.app.ActivityThread.main(ActivityThread.java:4363)
  E/AndroidRuntime( 1075):        at java.lang.reflect.Method.invokeNative(Native Method)
  E/AndroidRuntime( 1075):        at java.lang.reflect.Method.invoke(Method.java:521)
  E/AndroidRuntime( 1075):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
  E/AndroidRuntime( 1075):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
  E/AndroidRuntime( 1075):        at dalvik.system.NativeStart.main(Native Method)
  E/AndroidRuntime( 1075): Caused by: java.lang.reflect.InvocationTargetException
  E/AndroidRuntime( 1075):        at android.widget.LinearLayout.&lt;init&gt;(LinearLayout.java:92)
  E/AndroidRuntime( 1075):        at java.lang.reflect.Constructor.constructNative(Native Method)
  E/AndroidRuntime( 1075):        at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
  E/AndroidRuntime( 1075):        at android.view.LayoutInflater.createView(LayoutInflater.java:500)
  E/AndroidRuntime( 1075):        ... 52 more
  E/AndroidRuntime( 1075): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/button_real_world.xml from drawable resource ID #0x7f020002
  E/AndroidRuntime( 1075):        at android.content.res.Resources.loadDrawable(Resources.java:1693)
  E/AndroidRuntime( 1075):        at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
  E/AndroidRuntime( 1075):        at android.view.View.&lt;init&gt;(View.java:1
  </code></pre>