I want to open pictures in the action from the fragment pass the path to the picture
public void openImage(String image) { Intent intent = new Intent(getActivity(), FullscreenActivity.class); Bundle b = new Bundle(); b.putString("image", image); intent.putExtras(b); startActivity(intent); } and I want to get the path that I put in the Bundle
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_drawer_layout); if(savedInstanceState == null) { loge("savedinstance == null"); } String image = savedInstanceState.getString("image"); ImageView imgView = (ImageView) findViewById(R.id.imageView4); imgView.setImageDrawable(Drawable.createFromPath(image)); } it turns out that bundle is null and accordingly issues an exception