D DoctorGerry Member Licensed User Longtime User Oct 26, 2014 #1 Hi, I have an activity where a user can enter info about an item and then click a button to take a photo of the item. The camera opens in a new activity which allows the user to take the photo, give it a name and save it. How do I then display that photo in the original calling activity?
Hi, I have an activity where a user can enter info about an item and then click a button to take a photo of the item. The camera opens in a new activity which allows the user to take the photo, give it a name and save it. How do I then display that photo in the original calling activity?
LucaMs Expert Licensed User Longtime User Oct 26, 2014 #2 You could put a routine like this in the "original" activity: Code: Copy Public Sub PhotoIsReady ImageView1.Bitmap = LoadBitmap(...) End sub and call it from the second Activity using Code: Copy CallSubDelayed(OriginalActivityName, "PhotoIsReady") You could also pass the folder and name of the image file: Code: Copy Public Sub PhotoIsReady(PhotoDir As String, PhotoName As String) ImageView1.Bitmap = LoadBitmap(...) End sub Code: Copy CallSubDelayed3(OriginalActivityName, "PhotoIsReady", PhotoDir, PhotoName) Upvote 0
You could put a routine like this in the "original" activity: Code: Copy Public Sub PhotoIsReady ImageView1.Bitmap = LoadBitmap(...) End sub and call it from the second Activity using Code: Copy CallSubDelayed(OriginalActivityName, "PhotoIsReady") You could also pass the folder and name of the image file: Code: Copy Public Sub PhotoIsReady(PhotoDir As String, PhotoName As String) ImageView1.Bitmap = LoadBitmap(...) End sub Code: Copy CallSubDelayed3(OriginalActivityName, "PhotoIsReady", PhotoDir, PhotoName)
RandomCoder Well-Known Member Licensed User Longtime User Oct 26, 2014 #3 The simplest way would be to declare the image as a process global. It can be accessed by all activities, code modules and services. Upvote 0
The simplest way would be to declare the image as a process global. It can be accessed by all activities, code modules and services.
LucaMs Expert Licensed User Longtime User Oct 26, 2014 #4 RandomCoder said: The simplest way would be to declare the image as a process global. It can be accessed by all activities, code modules and services. Click to expand... It's true, but i don't like it. I think that using the method I have suggested, the code is more readable and "safe" (ie, no other activity can modify the variable, in this case the image). [Basically, using this method, you can handle an Activity as though it were a function, almost as an input dialog] Upvote 0
RandomCoder said: The simplest way would be to declare the image as a process global. It can be accessed by all activities, code modules and services. Click to expand... It's true, but i don't like it. I think that using the method I have suggested, the code is more readable and "safe" (ie, no other activity can modify the variable, in this case the image). [Basically, using this method, you can handle an Activity as though it were a function, almost as an input dialog]
D DoctorGerry Member Licensed User Longtime User Oct 27, 2014 #5 Thanks for the replies. Much obliged Upvote 0