我已將自定義系統服務添加到AOSP。我想在Activity.java類中使用我的服務,並想在startActivityForResult()方法中做一些更改。與我想要爲PackageManagerService創建實例的方式相同。但由於某些原因,我不能得到這個跑,我從logcat中得到以下錯誤:AOSP:在Activity.java中創建SystemService實例時出錯
***********************************************
F/SystemServer( 500): BOOT FAILURE starting Input Manager Service
F/SystemServer( 500): java.lang.RuntimeException: Unable to get provider com.android.providers.settings.SettingsProvider: java.lang.ClassNotFoundException: com.android.providers.settings.SettingsProvider
F/SystemServer( 500): at android.app.ActivityThread.installProvider(ActivityThread.java:4201)
F/SystemServer( 500): at android.app.ActivityThread.getProvider(ActivityThread.java:4010)
F/SystemServer( 500): at android.app.ActivityThread.acquireProvider(ActivityThread.java:4026)
F/SystemServer( 500): at android.app.ContextImpl$ApplicationContentResolver.acquireProvider(ContextImpl.java:1612)
F/SystemServer( 500): at android.content.ContentResolver.acquireProvider(ContentResolver.java:948)
F/SystemServer( 500): at android.provider.Settings$NameValueCache.getString(Settings.java:701)
F/SystemServer( 500): at android.provider.Settings$Secure.getString(Settings.java:2207)
F/SystemServer( 500): at com.android.server.InputMethodManagerService.buildInputMethodListLocked(InputMethodManagerService.java:1966)
F/SystemServer( 500): at com.android.server.InputMethodManagerService.(InputMethodManagerService.java:556)
F/SystemServer( 500): at com.android.server.ServerThread.run(SystemServer.java:273)
F/SystemServer( 500): Caused by: java.lang.ClassNotFoundException: com.android.providers.settings.SettingsProvider
F/SystemServer( 500): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
F/SystemServer( 500): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
F/SystemServer( 500): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
F/SystemServer( 500): at android.app.ActivityThread.installProvider(ActivityThread.java:4186)
F/SystemServer( 500): ... 9 more
I/SystemServer( 500): Accessibility Manager
W/SystemServer( 500): ***********************************************
F/SystemServer( 500): BOOT FAILURE making display ready
我怎樣才能使服務的實例在Activity.java。在Activity.java中還有一個systemReady()類型的方法,我知道PackageManagerService中有這樣的方法,但是這是一個服務,其中Activity不是。所以想知道什麼是檢查它的最好方法。任何想法讚賞