Android Execute Method From Another Activity
I am calling from activityA a method that is on activityB. Method is called from A to B properly but when I execute inside it webviewB.loadUrl(myUrl), app crashes for a nullpointer
Solution 1:
Either intents as suggested by Ortisi. Or Why don't you try creating a class, create that method in this class, And call that method from both the activity.
Solution 2:
The best way to communicate between activities is using the Intent mechanism. So just launch an intent from activityA in order to communicate to activityB that its loadUrl method should run.
Or for other solutions you can read this question: Best way to accomplish inter-activity communication in an Android TabHost application
Post a Comment for "Android Execute Method From Another Activity"