0

I want to pass the WebView from One activity to another Activity. how to do that. I referred How do I pass an object from one activity to another on Android? but still not getting any idea for this. Please help me to get this....

Community
  • 1
  • 1
Ponmalar
  • 6,871
  • 10
  • 50
  • 80
  • I have declared the WebView as public. Now i can access that webview anywhere and i can load the result in this webview – Ponmalar May 14 '12 at 10:09

3 Answers3

1

Sounds to me like you may want a broadcast receiever... try looking here: BroadcastReceiver

That will let one activity send a message to another

Drake Clarris
  • 1,047
  • 6
  • 10
0

either u try to use finish() an the passed Activity or you simply call finish() in the activity after it's done with it's calculations

Thkru
  • 4,218
  • 2
  • 18
  • 37
  • After Calling the Finish(), then how can i get the result. Please explain – Ponmalar May 10 '12 at 11:46
  • you could set it in a static variable via setter in your java (not activity) class. but just btw: why do u want to use an activity for calculations? I think it's not the intended way. – Thkru May 10 '12 at 12:28
  • in this case your choice would be a static variable or a broadcastReceiver to make this work. ;) – Thkru May 10 '12 at 13:01
0

Are you sure you want that in an Android activity, not just a normal Java class?

James Cross
  • 7,799
  • 8
  • 24
  • 30
  • Sample.java is normal java class. from this i started the second activity. – Ponmalar May 10 '12 at 11:45
  • My point is that you should only use an Activity when you are displaying something to the user or getting input from the user. If the class is only doing calcuations it shouldn't be an Activity. – James Cross May 10 '12 at 11:47
  • actually i'm doing the Camera activity in the new activity , from this i have to pass the captured image url to html page. Otherwise tell me how to send current webview to new Activity while starting this(from sample.java) – Ponmalar May 10 '12 at 11:49