given the the below code,how can i make the constructor of a generic type so that it can accept any class passed to it
code:
ServiceCtrl(Context ctx, Class<SPPService> sppServiceClass) {
this.mCtx = ctx;
this.mClass = sppServiceClass;
}
public boolean isMyServiceRunning() {
ActivityManager manager = (ActivityManager) this.mCtx.getSystemService(this.mCtx.ACTIVITY_SERVICE);
for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if (this.mClass.getName().equals(service.service.getClassName())) {
return true;
}
}
return false;
}