when trying to use the inventory connector to get a list of items.
I am getting an account back and creating the connector but when I try to use it I get a binding exception.
could anyone give me some pointers on the best way to implemenbt this or some suggestions of what could be causing the issue? Its my first time properly utilising the sdk instead of the api.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);mTextView = findViewById(R.id.activity_main_text_view); if (mAccount == null) {
mAccount = CloverAccount.getAccount(this); if (mAccount == null) {
return;}
}
connect();mInventory = new Inventory(); try{
InventoryAsyncTask Async = new InventoryAsyncTask(mInventoryConnector);Async.execute();mInventory.ItemList = Async.get();}catch (InterruptedException|ExecutionException e) {
e.printStackTrace();}
}
public class InventoryAsyncTask extends AsyncTask<Void, Void, List<Item>> {
public InventoryAsyncTask(InventoryConnector mInventoryConnector){
iInventoryConnector = mInventoryConnector;}
private InventoryConnector iInventoryConnector;@Overrideprotected final List<Item> doInBackground(Void... params) {
try {
return iInventoryConnector.getItems();} catch (RemoteException | ClientException | ServiceException | BindingException e) {
e.printStackTrace();}
return null;}
}