0

I have two Activities, Activity_1 and Activity_2.

In Activity_1, I have an ImageView and a Button called "Go to Next".

In Activity_2, I have a Button called "CreatePDF".

So, I just want to know how to create a PDF with an image from Activity_1 when I press the CreatePDF button in Activity_2.

I would thankful if any one can solve this.

Thank You

Bruno
  • 3,872
  • 4
  • 20
  • 37
Amila
  • 1

1 Answers1

0

From the few details you are giving here, I assume the Activity_2 does not know the image you want to export.

So first, you need to pass a reference to the image, or the image data itself, from Activity_1 to Activity_2.

See this post which may have what you're looking for.

The accepted answer is suggesting to use one of these three solutions:

  • Convert the image from Bitmap to byte array, then pass this byte array from one activity to another using an Intent object.
  • Save the image to the SD Card (or anywhere on the phone) and pass the image file path as a string from one activity to another, using an Intent object.
  • Pass the Bitmap image using an Intent object, without converting it.

I hope this helps.

Lucas S.
  • 702
  • 2
  • 11
  • 22