We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
之前service0 启动后 验证 service 已经起~ public static boolean isServiceExisted(Context context, String className) { ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); List<ActivityManager.RunningServiceInfo> serviceList = activityManager.getRunningServices(Integer.MAX_VALUE); if(!(serviceList.size() > 0)) { return false; } for(int i = 0; i < serviceList.size(); i++) { ActivityManager.RunningServiceInfo serviceInfo = serviceList.get(i); ComponentName serviceName = serviceInfo.service; if(serviceName.getClassName().equals(className)) { return true; } } return false; }
但是到了 B APP进程里 总是绑不上~
The text was updated successfully, but these errors were encountered:
解决了 public class MyService extends HermesService {
private IBinder mBinder = new IHermesService.Stub(){ @Override public Reply send(Mail mail) throws RemoteException { return null; } @Override public void register(IHermesServiceCallback callback, int pid) throws RemoteException { } @Override public void gc(List<Long> timeStamps) throws RemoteException { } }; @Override public IBinder onBind(Intent intent) { return mBinder; }
}
Sorry, something went wrong.
感觉必须要自己写一个Service 通过 隐式 action的方式调用 才能成功。
No branches or pull requests
之前service0 启动后 验证 service 已经起~
public static boolean isServiceExisted(Context context, String className) {
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningServiceInfo> serviceList = activityManager.getRunningServices(Integer.MAX_VALUE);
if(!(serviceList.size() > 0)) {
return false;
}
for(int i = 0; i < serviceList.size(); i++) {
ActivityManager.RunningServiceInfo serviceInfo = serviceList.get(i);
ComponentName serviceName = serviceInfo.service;
if(serviceName.getClassName().equals(className)) {
return true;
}
}
return false;
}
但是到了 B APP进程里 总是绑不上~
The text was updated successfully, but these errors were encountered: