I am trying to pass a bitmap from one fragment to another--and am using this post as a guide:
send Bitmap using intent Android
What i am having trouble with is in the receiving activity fragment using getIntent(). It doesn't recognize the method. there are some posts out there saying that its not possible to use getIntent() in a fragment... but there must be a way? should the code go in the host activity?
here is what i am trying:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String filename = getIntent().getStringExtra("image");
try {
FileInputStream is = this.openFileInput(filename);
imageBitmap = BitmapFactory.decodeStream(is);
is.close();
} catch (Exception e) {
e.printStackTrace();
}
}