title: Passing Image URI from one activity to other activity to show selected image from gallery in imageview of second activity
body: <p>My <code>MainActivity.java</code> file contains following from where my app starts after going through share via button from a image in gallery.</p>
  
  <pre><code>Intent intent = new Intent(MainActivity.this,BoardView.class);
  intent.setType("image/*");
  intent.setAction(Intent.ACTION_GET_CONTENT);
  intent.putExtra("image", path);
  startActivity(intent);
  </code></pre>
  
  <p>My Second Activity named <code>BoardView</code> accepts the image as :</p>
  
  <pre><code>Intent ii = getIntent();
  Bundle b = ii.getExtras();
  if(b!= null) {
      String image = ii.getStringExtra("image");
      view_news.setVisibility(View.VISIBLE);
  }
  </code></pre>
  
  <p>But I am not getting my image in second activity.
  Actually the first activity is Login and second activity shows the image after login.</p>
  
  <p>EDIT :
  Logcat shows error</p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.chawlaz.cubetboard/com.example.chawlaz.cubetboard.BoardView}: java.lang.NullPointerException: uriString
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
          at android.app.ActivityThread.access$800(ActivityThread.java:135)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:136)
          at android.app.ActivityThread.main(ActivityThread.java:5001)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:515)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
          at dalvik.system.NativeStart.main(Native Method)
   Caused by: java.lang.NullPointerException: uriString
          at android.net.Uri$StringUri.&lt;init&gt;(Uri.java:467)
          at android.net.Uri$StringUri.&lt;init&gt;(Uri.java:457)
          at android.net.Uri.parse(Uri.java:429)
          at com.example.chawlaz.cubetboard.BoardView.onCreate(BoardView.java:156)
          at android.app.Activity.performCreate(Activity.java:5231)
  
  
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
                      at
  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
                      at android.app.ActivityThread.access$800(ActivityThread.java:135)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:136)
                      
  
      at android.app.ActivityThread.main(ActivityThread.java:5001)
                          at java.lang.reflect.Method.invokeNative(Native Method)
                          at java.lang.reflect.Method.invoke(Method.java:515)
                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
                          at dalvik.system.NativeStart.main(Native Method)
  </code></pre>