我有一个扩展 Intent 服务的类。我想从此活动开始服务,但出现错误:
Intent msgIntent = new Intent();
msgIntent.setClass(testActivity, testActivity.class);
startService(msgIntent);
07-15 11:53:33.030: E/AndroidRuntime(28989): java.lang.NullPointerException
07-15 11:53:33.030: E/AndroidRuntime(28989): at android.content.ContextWrapper.getApplicationContext(ContextWrapper.java:109)
如何从同一活动开始服务?