Hi all,

I got an problem on getting the TelephonyManager in my personal service. The
code  as below:

public class MyService extends Service {

@Override
public IBinder onBind(Intent intent) {
return mBinder;
}

/**
 * The implementation of IMyService defined through AIDL.
 */
public IBinder mBinder = new IMyService.Stub() {

public Map getConfig() {
...
TelephonyManager tel =
(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);

...

The code will throw an NullPointerException on the
line:  (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);

why??

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to