Lifetime of an app's Context object

by Jin Chiu » Tue, 20 Jul 2010 08:30:35 GMT

Sponsored Links
 What is the lifetime of an app's global android.content.Context
object? Does it last until the last component of the app is terminated
by the Android runtime?


Lifetime of an app's Context object

by stephan » Wed, 21 Jul 2010 00:16:22 GMT

 I whould definitely expect that. Anyway you need a reference to the
Context object if you like access it. As long as that reference exists
the context exist.



Sponsored Links

Other Threads

1. setselection() doesn't have visual effect

I have create a listview . When listview is created I used
setSelection(0) to set it to first listitem.

But there is no visual effect, the selected  listitem is not changed
to listed color.

In my application, I want to high light the first listItem by default.
Does anyone know how to do that?




2. Problem debugging Android Bootup Service

Android Experts,

    I have a simple Android Service, which should start on device
bootup. However, I cannot debug this using Eclipse on Windows.

The error I get from Logcat is

10-01 21:06:30.788: DEBUG/AndroidRuntime(487): >>>>>>>>>>>>>>
AndroidRuntime START <<<<<<<<<<<<<<
10-01 21:06:30.788: DEBUG/AndroidRuntime(487): CheckJNI is ON
10-01 21:06:31.008: DEBUG/AndroidRuntime(487): --- registering native
functions ---
10-01 21:06:32.008: DEBUG/AndroidRuntime(487): Shutting down VM
10-01 21:06:32.008: DEBUG/dalvikvm(487): De{*filter*} has detached; object
registry had 1 entries
10-01 21:06:32.038: INFO/AndroidRuntime(487): NOTE: attach of thread
'Binder Thread #3' failed

My manifest looks like

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=" http://www.***.com/ ;
android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
        <uses-permission android:name="android.permission.INTERNET" />
android:name="android.permission.ACCESS_FINE_LOCATION" />
android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-sdk android:minSdkVersion="8" />

    <application android:icon="@drawable/icon" android:label="@string/
app_name" android:debuggable="true">
        <service android:name=".DroidService">
android:name="com.preciseinc.DroidLocator.DroidService" />
        <receiver android:name=".ServiceAutoStarter">

I have a breakpoint in my ServiceAutoStarter code (below), which is
never hit.

public class ServiceAutoStarter extends BroadcastReceiver {

        public void onReceive(Context context, Intent intent) {
                Intent serviceIntent = new Intent();


Appreciate any and all Help.




3. Application without main activity

4. Listview problems

5. libjingle ported to java

6. Layout_gravity for a button

7. FYI if you are having trouble in using DOM Parser for parsing general response