Intent.PutExtra 'to send string'
Intent.GetExtra 'to receive string'
Dim in As Intent
in.Initialize(in.ACTION_MAIN, "") ' I added this line, originally not found
Dim pm As PackageManager
in = pm.GetApplicationIntent("b4a.TelegramBot")
in.PutExtra("android.intent.extra.BotMessage","String I want on second app")
If in.IsInitialized Then StartActivity(in)
dim pm as packemanager
dim intent as intent
intent.Initialize(intent.ACTION_SEND,"")
intent.PutExtra("text","hello, kattah!" )
intent.SetType("text/plain")
Dim possibleApps As List = pm.QueryIntentActivities(intent)
If possibleApps.IsInitialized Then
Log("your device claims it has " & possibleApps.Size & " app(s) to handle images...")
StartActivity(intent)
End If
Dim in As Intent
in.Initialize(in.ACTION_MAIN, "") ' I added this line, originally not found
Dim pm As PackageManager
in = pm.GetApplicationIntent("b4a.TelegramBot")
in.PutExtra("android.intent.extra.BotMessage","String I want on second app")
If in.IsInitialized Then StartActivity(in)
Dim in As Intent
Dim pm As PackageManager
in = pm.GetApplicationIntent("YOUR_FULL_PACKAGE_NAME")
If in.IsInitialized Then
StartActivity(in)
else
log("intent was not initialixzed")
end if
the error is probably related to a not existent answer fromthe error is:
java.lang.RuntimeException: Object should first be initialized (Intent).
if PM does not find an installed app with this packagename it probably return null or an uninitialized Intent.in = pm.GetApplicationIntent("b4a.TelegramBot")
intent.Initialize(intent.ACTION_SEND,"")
intent.SetComponent("FULL_PACKAGE_NAME")
intent.PutExtra("text","hello, kattah!" )
intent.SetType("text/plain")
A traditional way that works across different OSes and technologies is good old fashioned TCP sockets. You can transfer data both ways, you have a lot of the infrastructure details handled for you.If this is not possible, I have two options:
- One of the two applications writes a text file and the other reads it (As you say).
- To put the value in the clipboard..
1. Where did you copy the code from?This is Provider and Requester application.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?