when i run my code with compileSdkVersion 30 doesn't work but in 29 code working
Intent intent = new Intent();
intent.setPackage("com.androidlearn.securityman");
ServiceConnection serviceConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
Log.e("","");
Toast.makeText(context,"onServiceConnected",Toast.LENGTH_LONG).show();
listener.onSuccess(IPaymentInterface.Stub.asInterface(service));
}
@Override
public void onServiceDisconnected(ComponentName name) {
Toast.makeText(context,"onServiceDisconnected",Toast.LENGTH_LONG).show();
Log.e("","");
listener.onFailure("connection failed");
}
};
context.bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE);
}
In api 30 bindService return false and serviceConnection doesn't respond to listeners
How to solve this problem ?