Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8096209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:22:48+00:00 2026-06-05T21:22:48+00:00

I am totally new in appbiling service in android, and it seems to be

  • 0

I am totally new in appbiling service in android, and it seems to be a little bit complicated for me, I have done all the initial procedures to implement it , but I am stuck in the purchase state(I think so).I have a list view and in the onitem click listener I have done this:

@Override
    public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
        purchaseposition= position;
        if(list.get(position).getPurchase().contentEquals("Buy")){
         val = billingService.requestPurchase("android.test.purchased", payloadContents);

        }else{
        SharedPreferences.Editor editor = preference.edit();
        editor.putInt("URLPOSITION", position);
        editor.commit();
        Intent quiz=new Intent("com.powergroupbd.appbil.QUIZACTIVITY");
        startActivity(quiz);
        }
    }

that means if the list view contains a text ‘Buy’ then I am sending request to the market to buy with the test purchase id.Now I want that if purchase is successfull then I will change the text of the list view from ‘Buy’ to ‘Play’ and enable the quiz to be played. But here is the part where I think I missed everthing. In the purchase state change I wrote this code to do this:

@Override
        public void onPurchaseStateChange(PurchaseState purchaseState,
                String itemId, int quantity, long purchaseTime,
                String developerPayload) {
            if (Consts.DEBUG) {
                Log.i("Tag", "onPurchaseStateChange() itemId: " + itemId + " "
                        + purchaseState);
            }

            if (purchaseState == PurchaseState.PURCHASED) {
                ownedItems.add(itemId);
                list.get(purchaseposition).setPurchase("Play");
            }
            // YOU can also add other checks here
        }

but it never change the text of the listview and I can never play the quiz, Please I need a complete Idea how can I do this and where is my mistake? thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T21:22:50+00:00Added an answer on June 5, 2026 at 9:22 pm

    How are you displaying your data?

    if you are using a listview and an array adapter, you need to call adapter.notifyDataSetChanged(); This tells the adapter you have updated information and it can refresh the list. If your not using an array adapter, you could call findViewById(int) and dynamically change the view.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am totally new to C#. I have one service method //actual method public
I am totally new to android, i am trying to implement Sliding Menu having
Totally new to programming so kindly excuse the silly question. I have this URL
Totally new to Capistrano. I have a local git repository that I want to
I'm totally new to AWS. I managed to have an instance that runs PHPMyAdmin.
Totally new to Drupal so be gentle please! Let's say I have a number
I´m totally new to Powershell and wanted to write a script that deletes all
I am totally new to HTML5. Previously I have developed Silverlight and ASP .Net
I'm totally new to Ruby but not to programming. All I did was going
I'm totally new to Flex (moving away from Java for now :(). I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.