I've got two android apps, one wi开发者_如何学编程th a public void. How would the other app call this function?
You can not directly call the functions in another application. There are two ways to to achieve something like this.
The more complicated way would it be to have a service running that both your apps bind to to communicate. This would only be the way to go if you have frequent data sharings etc.
Another method is to use startActivityForResult. This will redirect the user to the activity of the other application and if the activity is finished you will be returned to your old activity and the set result is given to you in onActivityOnResult
精彩评论