title: Facing this error in my Code : java.lang.StringIndexOutOfBoundsException:
body: <p><strong>This is my logcat</strong></p>
  <p>Complete details of the error are listed below:</p>
  <pre><code>java.lang.StringIndexOutOfBoundsException: length=0; index=0
      at java.lang.String.charAt(Native Method)
      at android.graphics.Color.parseColor(Color.java:1384)
      at com.chetan.mobchat.Activities.MainActivity$1.onSuccess(MainActivity.java:115)
      at com.chetan.mobchat.Activities.MainActivity$1.onSuccess(MainActivity.java:81)
      at com.google.android.gms.tasks.zzn.run(com.google.android.gms:play-services-tasks@@17.2.0:4)
      at android.os.Handler.handleCallback(Handler.java:938)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:257)
      at android.app.ActivityThread.main(ActivityThread.java:8218)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1016)
  </code></pre>
  <p>This is my code in which there is an error in the line no 81 and 115 can any one help me in solving this error</p>
  <p><strong>Code:</strong></p>
  <p>81 ----</p>
  <pre><code>mFirebaseRemoteConfig.fetchAndActivate().addOnSuccessListener(new OnSuccessListener&lt;Boolean&gt;() {
                  @Override
                  public void onSuccess(Boolean aBoolean) {
      
                      String backgroundImage = mFirebaseRemoteConfig.getString(&quot;backgroundImage&quot;);
                      Glide.with(MainActivity.this)
                              .load(backgroundImage)
                              .into(binding.backgroundImage);
      
                      /* Toolbar Color */
                      String toolbarColor = mFirebaseRemoteConfig.getString(&quot;toolbarColor&quot;);
                      String toolBarImage = mFirebaseRemoteConfig.getString(&quot;toolbarImage&quot;);
                      boolean isToolBarImageEnabled = mFirebaseRemoteConfig.getBoolean(&quot;toolBarImageEnabled&quot;);
      
      
      
                      if(isToolBarImageEnabled) {
                          Glide.with(MainActivity.this)
                                  .load(toolBarImage)
                                  .into(new CustomTarget&lt;Drawable&gt;() {
                                      @Override
                                      public void onResourceReady(@NonNull @NotNull Drawable resource, @Nullable @org.jetbrains.annotations.Nullable Transition&lt;? super Drawable&gt; transition) {
                                          getSupportActionBar()
                                                  .setBackgroundDrawable(resource);
                                      }
      
                                      @Override
                                      public void onLoadCleared(@Nullable @org.jetbrains.annotations.Nullable Drawable placeholder) {
      
                                      }
                                  });
                      } else {
                          getSupportActionBar()
                                  .setBackgroundDrawable
                        115--                  (new ColorDrawable(Color.parseColor(toolbarColor)));
                      }
      
                  }
              });
  </code></pre>
  <p>line no 81 and 115 is marked in the code above</p>