Yes,
that dependency is already added but is it visible to second terminal a after i launch my payment fragment.
Because i do my code as follows.
private ServiceConnection mSecondScreenConnection = new ServiceConnection() {
public void onServiceConnected(ComponentName className, IBinder service) {
Log.d(TAG, "IPoyntSecondScreenService is now connected");
mSecondScreenService = IPoyntSecondScreenService.Stub
.asInterface(service);
loadDataToSecondScreen();
}
public void onServiceDisconnected(ComponentName className) {
Log.d(TAG,
"IPoyntSecondScreenService has unexpectedly disconnected");
mSecondScreenService = null;
}
};
public void loadDataToSecondScreen() {
try {
if (mSecondScreenService != null) {
BigDecimal total = new BigDecimal(0);
for (OrderItem item : items) {
BigDecimal price = new BigDecimal(item
.getUnitPrice());
price.setScale(2, RoundingMode.HALF_UP);
price = price.multiply(new BigDecimal(item
.getQuantity()));
total = total.add(price);
}
mSecondScreenService.showItem(items, total.longValue(),
“USD”);
}
} catch (RemoteException e) {
e.printStackTrace();
}
}