, . . Activity - , . , , Activity onDestroy(). , (, ). , , onDestroy(), , , .
. , . , .
UPDATE
, Activity. ( ApplicationContext, Activity , ).
, , WebService:
class WebService
{
private final Context mContext;
public WebService(Context ctx)
{
mContext = ctx.getApplicationContext();
}
public void someFunc(String filename) throws IOException
{
InputStream iS = mContext.getAssets().open("www/"+filename);
}
}
WebService Service ( ) Activity ( , , - ).
Service:
class MyService extends Service
{
WebService mWs;
@Override
public void onCreate()
{
super.onCreate();
mWs = new WebService(this);
}
@Override
public IBinder onBind(Intent intent)
{
return null;
}
}