Static variable in Application class returns null when accessing it
问题 I am defining a variable in application class like this public static ResultReceiver myResultReceiver = null; In some activities I am extending ResultReceiver and assigning to myResultReceiver, in stop() of activities I am making it null. Though myResultReceiver is not null yet when I access it from an intentservice it is null. The code was working fine till today. 回答1: May be, just may be you have the service on another process using the android:process or android:isolatedProcess attribute.