问题1:在androidmanefist.xml加入service的定义之后出现了exported service does not require permission
回答: 你的service不需要权限设置,内部就可以调用,你把加的限制或者intent-filter去掉试试
问题2:apk安装进去之后遇到出错:PhoneFactory.getDefaultPhone must be called from Looper thread
回答:由于phone的包导错了,查看安卓源码其他apk的里面导入的包即可
问题3:包导对了之后发现遇到出错:java.lang.SecurityException: Not allowed to start service Intent { cmp=com.example.lisa/.Service1 } without permission not exported from uid 1000
回答:需要在manifest.xml里
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lisa"
android:versionCode="1"
android:versionName="1.0" android:sharedUserId="android.uid.system">
<service android:name=".Service1"
android:process="com.android.phone"
>