nibbo Active Member Licensed User Longtime User Feb 19, 2020 #1 Hi All I have built an app that I want to use as a common activity in several other apps. Is using JavaObject and StartActivityForResult as per this thread https://www.b4x.com/android/forum/threads/using-startactivityforresult-with-javaobject.40374/ still the best way? I ask because this is a pretty old thread but I cannot seem to find any other way to do this? Can I use 'Wait For' to wait until the activity completes? Thanks Nibbo
Hi All I have built an app that I want to use as a common activity in several other apps. Is using JavaObject and StartActivityForResult as per this thread https://www.b4x.com/android/forum/threads/using-startactivityforresult-with-javaobject.40374/ still the best way? I ask because this is a pretty old thread but I cannot seem to find any other way to do this? Can I use 'Wait For' to wait until the activity completes? Thanks Nibbo
Erel B4X founder Staff member Licensed User Longtime User Feb 19, 2020 #2 nibbo said: Is using JavaObject and StartActivityForResult as per this thread https://www.b4x.com/android/forum/threads/using-startactivityforresult-with-javaobject.40374/ still the best way? Click to expand... It was never the best idea for interacting with your activities. Why do you need to have a common activity and not a common class? It will make things simpler. Upvote 0
nibbo said: Is using JavaObject and StartActivityForResult as per this thread https://www.b4x.com/android/forum/threads/using-startactivityforresult-with-javaobject.40374/ still the best way? Click to expand... It was never the best idea for interacting with your activities. Why do you need to have a common activity and not a common class? It will make things simpler.
nibbo Active Member Licensed User Longtime User Feb 19, 2020 #3 Erel said: Why do you need to have a common activity and not a common class? It will make things simpler. Click to expand... Hi Erel I have several warehouse apps running on rugged handhelds with built in barcode readers that all need to scan Stock Barcodes and Location QR Codes. There is a UI associated with this also so it does need to be an activity; correct me if I am wrong... Having it in a single app means that I only need to change it once should the requirements change in any way. It also means that I have the scanner service wrapped up in a single app and only need to mess about with one manifest if we start using different hardware/scanners etc. Thanks Upvote 0
Erel said: Why do you need to have a common activity and not a common class? It will make things simpler. Click to expand... Hi Erel I have several warehouse apps running on rugged handhelds with built in barcode readers that all need to scan Stock Barcodes and Location QR Codes. There is a UI associated with this also so it does need to be an activity; correct me if I am wrong... Having it in a single app means that I only need to change it once should the requirements change in any way. It also means that I have the scanner service wrapped up in a single app and only need to mess about with one manifest if we start using different hardware/scanners etc. Thanks
Erel B4X founder Staff member Licensed User Longtime User Feb 20, 2020 #4 nibbo said: There is a UI associated with this also so it does need to be an activity; correct me if I am wrong... Click to expand... This is wrong. You can use the same activity and implement parts of the UI in a class. Anyway, you can call other activities with CallSubDelayed. You can pass Me to the other activity and then call it back with another CallSubDelayed. Upvote 0
nibbo said: There is a UI associated with this also so it does need to be an activity; correct me if I am wrong... Click to expand... This is wrong. You can use the same activity and implement parts of the UI in a class. Anyway, you can call other activities with CallSubDelayed. You can pass Me to the other activity and then call it back with another CallSubDelayed.
nibbo Active Member Licensed User Longtime User Feb 20, 2020 #5 Thanks Erel, unfortunately I don't think my level of expertise extends to this just yet and I don't really have the time to experiment. I have got it working with StartActivityForResult but may revisit it again later if time permits; which I doubt... Ta Upvote 0
Thanks Erel, unfortunately I don't think my level of expertise extends to this just yet and I don't really have the time to experiment. I have got it working with StartActivityForResult but may revisit it again later if time permits; which I doubt... Ta