title: Android: SimpleDateFormat gives API Error
body: <p>I am using SimpleDateFormat on Android. I tested it with API 24 and it worked. When i try using it on API 16 it crashes.
  I have searched the Internet and i found people saying that it might be because of a wrong import statement (<code>import android.icu.text.SimpleDateFormat</code>) but i am already using <code>import java.text.SimpleDateFormat</code>.</p>
  
  <p>My code (it crashes on onclickButton):</p>
  
  <pre><code>import java.text.SimpleDateFormat;
  
  public class MainActivity extends AppCompatActivity {
  
  SimpleDateFormat sdf;
  String date;
  
      public void onclickButton (View view) {
  
          Calendar c = Calendar.getInstance();
          sdf = new SimpleDateFormat("dd MM YYYY");
          sdf.setTimeZone(TimeZone.getTimeZone("Europe/Berlin"));
          date = sdf.format(c.getTime());
      }
  ...
  }
  </code></pre>
  
  <p>Stacktrace:</p>
  
  <pre><code>W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xb111d228)
  E/AndroidRuntime: FATAL EXCEPTION: main
                java.lang.IllegalStateException: Could not execute method for android:onClick
                    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:293)
                    at android.view.View.performClick(View.java:4084)
                    at android.view.View$PerformClick.run(View.java:16966)
                    at android.os.Handler.handleCallback(Handler.java:615)
                    at android.os.Handler.dispatchMessage(Handler.java:92)
                    at android.os.Looper.loop(Looper.java:137)
                    at android.app.ActivityThread.main(ActivityThread.java:4745)
                    at java.lang.reflect.Method.invokeNative(Native Method)
                    at java.lang.reflect.Method.invoke(Method.java:511)
                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
                    at dalvik.system.NativeStart.main(Native Method)
                 Caused by: java.lang.reflect.InvocationTargetException
                    at java.lang.reflect.Method.invokeNative(Native Method)
                    at java.lang.reflect.Method.invoke(Method.java:511)
                    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)
                    at android.view.View.performClick(View.java:4084) 
                    at android.view.View$PerformClick.run(View.java:16966) 
                    at android.os.Handler.handleCallback(Handler.java:615) 
                    at android.os.Handler.dispatchMessage(Handler.java:92) 
                    at android.os.Looper.loop(Looper.java:137) 
                    at android.app.ActivityThread.main(ActivityThread.java:4745) 
                    at java.lang.reflect.Method.invokeNative(Native Method) 
                    at java.lang.reflect.Method.invoke(Method.java:511) 
                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
                    at dalvik.system.NativeStart.main(Native Method) 
                 Caused by: java.lang.IllegalArgumentException: Unknown pattern character 'Y'
                    at java.text.SimpleDateFormat.validateFormat(SimpleDateFormat.java:268)
                    at java.text.SimpleDateFormat.validatePattern(SimpleDateFormat.java:323)
                    at java.text.SimpleDateFormat.&lt;init&gt;(SimpleDateFormat.java:369)
                    at java.text.SimpleDateFormat.&lt;init&gt;(SimpleDateFormat.java:253)
                    at com.jonathan_tilly.adventskalender.MainActivity.onclickButton(MainActivity.java:34)
                    at java.lang.reflect.Method.invokeNative(Native Method) 
                    at java.lang.reflect.Method.invoke(Method.java:511) 
                    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288) 
                    at android.view.View.performClick(View.java:4084) 
                    at android.view.View$PerformClick.run(View.java:16966) 
                    at android.os.Handler.handleCallback(Handler.java:615) 
                    at android.os.Handler.dispatchMessage(Handler.java:92) 
                    at android.os.Looper.loop(Looper.java:137) 
                    at android.app.ActivityThread.main(ActivityThread.java:4745) 
                    at java.lang.reflect.Method.invokeNative(Native Method) 
                    at java.lang.reflect.Method.invoke(Method.java:511) 
                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
                    at dalvik.system.NativeStart.main(Native Method) 
  </code></pre>
  
  <p>Any help is appreciated!</p>