Hello greetings of the day,
I implemented below subscription code as sdk suggested. when I change subscription tire from app market getting same subscription ID every time how many times I changes different subscription.
Note :- We have 6 different subscription in app.
private void getAppObject() { new AsyncTask<Void, Void, App>() { @Override protected App doInBackground(Void... params) { try { if (connector != null) { return connector.getApp(); } } catch (RemoteException e) { e.printStackTrace(); } catch (ServiceException e) { e.printStackTrace(); } catch (BindingException e) { e.printStackTrace(); } catch (ClientException e) { e.printStackTrace(); } return null; } @Override protected void onPostExecute(App app) { super.onPostExecute(app); if (!isFinishing() && app != null) { appObject = app; appName.setText(getString(R.string.merchant_app_name, app.getName())); if (app.getCurrentSubscription() != null) { AppSubscription subscription = app.getCurrentSubscription(); if (Strings.isNullOrEmpty(subscription.getDescription())) { currentSubscription.setText(subscription.getName()); } else { currentSubscription.setText(getString(R.string.colon_separated_strings, subscription.getName(), subscription.getDescription())); } } if (app.getAvailableSubscriptions() != null) { subscriptions.removeAllViews(); for (AppSubscription subscription : app.getAvailableSubscriptions()) { // Only display active subscriptions if (subscription.getActive()) { TextView item = (TextView) getLayoutInflater().inflate(R.layout.item_text_view, null); if (Strings.isNullOrEmpty(subscription.getDescription())) { item.setText(subscription.getName()); } else { item.setText(getString(R.string.colon_separated_strings, subscription.getName(), subscription.getDescription())); } subscriptions.addView(item); } } } if (app.getAvailableMetereds() != null) { metereds.removeAllViews(); for (AppMetered metered : app.getAvailableMetereds()) { // Only display active subscriptions if (metered.getActive()) { TextView item = (TextView) getLayoutInflater().inflate(R.layout.item_text_view, null); item.setText(getString(R.string.metered_string, metered.getAmount(), metered.getAction())); metereds.addView(item); } } } } } }.execute(); }
Can you let me know what is wrong ?