You could make the Connection
member static and choose a access level modifier keyword that allows other Activities access that member.
But, you usually don't want to have the Connection
be handled within an Activity, but within an class that extends Service
. There are a bunch of open source apps out there that use aSmack, have a look at their source.