title: Nullpointer exception for AndroidImageSlider DefaultSliderView In Android Studio, Build 22.0.1
body: <p>This is my stack trace : </p>
  
  <pre><code>08-16 10:23:40.006  19022-19022/com.world.innov.ebilling     E/AndroidRuntime﹕ FATAL EXCEPTION: main
  Process: com.world.innov.ebilling, PID: 19022
  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.world.innov.ebilling/com.world.innov.ebilling.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Bundle.putString(java.lang.String, java.lang.String)' on a null object reference
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
      at android.app.ActivityThread.access$800(ActivityThread.java:151)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:135)
      at android.app.ActivityThread.main(ActivityThread.java:5257)
      at java.lang.reflect.Method.invoke(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:372)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Bundle.putString(java.lang.String, java.lang.String)' on a null object reference
      at com.world.innov.ebilling.MainActivity.onCreate(MainActivity.java:52)
      at android.app.Activity.performCreate(Activity.java:5990)
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)          at android.app.ActivityThread.access$800(ActivityThread.java:151)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:135)
      at android.app.ActivityThread.main(ActivityThread.java:5257)
      at java.lang.reflect.Method.invoke(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:372)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
  </code></pre>
  
  <p>This is my activity :</p>
  
  <pre><code>import java.util.HashMap;
  import com.daimajia.slider.library.SliderLayout;
  import com.daimajia.slider.library.SliderTypes.BaseSliderView;
  import com.daimajia.slider.library.SliderTypes.BaseSliderView.OnSliderClickListener;
  import com.daimajia.slider.library.SliderTypes.DefaultSliderView;
  
  
  import android.app.Activity;
  import android.content.Intent;
  import android.content.SharedPreferences;
  import android.content.SharedPreferences.Editor;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.view.Window;
  import android.widget.Button;
  
  
  public class MainActivity extends Activity implements OnSliderClickListener {
  public static final String MY_PREFS_NAME = "MyPrefsFile";
  private SliderLayout mDemoSlider;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      requestWindowFeature(Window.FEATURE_NO_TITLE);
      setContentView(R.layout.activity_main);
  
  
      mDemoSlider = (SliderLayout) findViewById(R.id.slider);
  
      HashMap&lt;String, Integer&gt; file_maps = new HashMap&lt;String, Integer&gt;();
  
      file_maps.put("A", R.drawable.invoicebyhand);
      file_maps.put("B", R.drawable.invoicebymobile);
      file_maps.put("C", R.drawable.analysis);
  
      for (String name : file_maps.keySet()) {
          DefaultSliderView defaultSliderView = new DefaultSliderView(this);
          // initialize a SliderLayout
          defaultSliderView
                  .description(name)
                  .image(file_maps.get(name))
                  .setScaleType(BaseSliderView.ScaleType.Fit)
                  .setOnSliderClickListener(this);
  
          //add your extra information
          defaultSliderView.getBundle()
                  .putString("extra", name);
  
          mDemoSlider.addSlider(defaultSliderView);
      }
              mDemoSlider.setPresetTransformer(SliderLayout.Transformer.RotateUp);
      mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
      mDemoSlider.stopAutoCycle();
  
  
      SharedPreferences prefs = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE);
      String pin = prefs.getString("pin", "");
  
      if (pin.equals("")) {
          disableLetsGo();
          Intent i = new Intent(this, TOCActivity.class);
          startActivity(i);
      } else {
          disableSignUp();
      }
  
  }
  
  @Override
  public void onSliderClick(BaseSliderView slider) {
      // TODO Auto-generated method stub
  
  }
  }
  </code></pre>
  
  <p><strong>My question is "can anybody see why am i getting null pointer exception at line 52 for i guess defaultSliderView"?</strong> </p>
  
  <pre><code>line 52 is : defaultSliderView.getBundle()
                  .putString("extra", name);
  </code></pre>
  
  <p>I am using android studio with 22.0.1 buildtoolversion. I did not face this problem while i was doing this project on eclipse. This is the first time i am using android studio. I completely migrated the project with success and i am getting run time exception. I am using androidimageslider by daimajia.</p>
  
  <p><strong>Update: defaultSliderView is returning null bundle(Thanks @HariRam). How should i proceed or is there anything to replace bundle ?</strong>  </p>
  
  <p><strong>Update2: I removed line 52. Its now working.</strong></p>