A apty Active Member Licensed User Longtime User Oct 29, 2016 #1 I have two apps with different package names. I can launch an activity in the second app from the first app using intents. Now i want to pass the first app's name to the second app and display it in the textbox of the activity launched from first app (i.e. when first app calls second app's activity, the activity displays with a textbox that shows first app's name). I need some help on how to do this..Thanks
I have two apps with different package names. I can launch an activity in the second app from the first app using intents. Now i want to pass the first app's name to the second app and display it in the textbox of the activity launched from first app (i.e. when first app calls second app's activity, the activity displays with a textbox that shows first app's name). I need some help on how to do this..Thanks
MikeH Well-Known Member Licensed User Longtime User Oct 29, 2016 #2 One way is to put the text into the copy buffer from app 1 and read it from app 2 Upvote 0
A apty Active Member Licensed User Longtime User Oct 29, 2016 #3 Please assist with some code. Please Upvote 0
MikeH Well-Known Member Licensed User Longtime User Oct 29, 2016 #4 https://www.b4x.com/android/help/clipboard.html Upvote 0
A apty Active Member Licensed User Longtime User Oct 29, 2016 #5 Thanks a lot. That works very well. I wish i could also pass non text e.g image Upvote 0
DonManfred Expert Licensed User Longtime User Oct 29, 2016 #6 https://www.b4x.com/android/forum/threads/sharing-files-from-your-app-with-file-provider.70458/ Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 30, 2016 #7 You can also use the intent itself to send more data. Code: Copy Dim in As Intent in.Initialize(in.ACTION_MAIN, "") in.SetComponent("...") in.PutExtra("name", "myname") StartActivity(in) You can use Activity.GetStartingIntent to get the intent that caused the activity to start and then fetch the values. (make sure to check that the intent is new: https://www.b4x.com/android/forum/t...intent-be-reset-or-cleared.38004/#post-224814 ) Upvote 0
You can also use the intent itself to send more data. Code: Copy Dim in As Intent in.Initialize(in.ACTION_MAIN, "") in.SetComponent("...") in.PutExtra("name", "myname") StartActivity(in) You can use Activity.GetStartingIntent to get the intent that caused the activity to start and then fetch the values. (make sure to check that the intent is new: https://www.b4x.com/android/forum/t...intent-be-reset-or-cleared.38004/#post-224814 )
A apty Active Member Licensed User Longtime User Oct 30, 2016 #8 Thanks a lot Erel and DonManfred. What i wanted to do is pass some text and image from app one to app two. I have managed to pass the text. Now in app one i have an image in an image view, i wanted to pass that to an imageview in app two through an intent. I am thinking i should pass the image as bytes (through clipboard maybe) and convert the bytes back in app two in to an image..Is there a better way of doing this? Upvote 0
Thanks a lot Erel and DonManfred. What i wanted to do is pass some text and image from app one to app two. I have managed to pass the text. Now in app one i have an image in an image view, i wanted to pass that to an imageview in app two through an intent. I am thinking i should pass the image as bytes (through clipboard maybe) and convert the bytes back in app two in to an image..Is there a better way of doing this?
JakeBullet70 Well-Known Member Licensed User Longtime User Oct 31, 2016 #9 Just create a shared folder and copy it there. Send your text to the other app and that can read and delete when done Upvote 0
Just create a shared folder and copy it there. Send your text to the other app and that can read and delete when done