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 3402494
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:08:41+00:00 2026-05-18T05:08:41+00:00

Me Doing edu.sju.BlackJack Is not causing updates that are later called to occur. I

  • 0

Me Doing “edu.sju.BlackJack” Is not causing updates that are later called to occur.
I reference the layout correctly and the calls that are supposed to update it are correct, so what do I put in for the package name?

I should add that my package name according to the manifest is the above.
This is the code I have now which currently doesn’t update the screen (or i’m guessing change the value correctly).

RemoteViews name = new RemoteViews(“edu.sju.BlackJack”, R.layout.play_screen);

If that’s not it.. would it then be this code?

name.setTextViewText(R.id.Dealer_Total, “0”);

Dealer_Total is the id for the TextView that I want to change.. however again the Change is not occurring.

Thanks in advance for any and all assistance.

Here is the whole of my code that i’m talking about, first Playscreen.java

package edu.sju.BlackJack;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.widget.ImageView;
import android.widget.RemoteViews;
import android.widget.TextView;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import java.util.*;


public class PlayScreen extends Activity implements OnClickListener {
    /** Called when the activity is first created. */
    GameEngine Engine = new GameEngine();
     @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.play_screen);
        TextView TextDealer =  (TextView)findViewById(R.id.Dealer_Total); 
        Engine.setView(TextDealer);
        //Set up click listeners for all the buttons
        View hitButton = findViewById(R.id.hit_button);
        hitButton.setOnClickListener(this);
        View standButton = findViewById(R.id.stand_button);
        standButton.setOnClickListener(this);
        //new preplay button (ML 10/24/10)
        View prePlayButton = findViewById(R.id.prePlay_button);
        prePlayButton.setOnClickListener(this);
        Thread thread = new Thread(Engine);
        thread.start();


    }   

    public void onClick(View v) {
        switch (v.getId()) {

            case R.id.prePlay_button:
                v.setVisibility(View.GONE);
                System.out.println("Working?");
                Engine.setGameStart(1);
                break;
            case R.id.hit_button:
                Engine.gameHit(1);
                break;
            case R.id.stand_button:
                Engine.gameStand(1);
                break;
        }

            // More buttons go here (if any) ...    
        }
}

Now here’s the GameEngine Thread
Not the Whole of it, just enough so you get the idea


package edu.sju.BlackJack;

import java.util.Random;

import android.widget.RemoteViews;
import android.widget.TextView;

public class GameEngine   implements Runnable {
    static int playerCount = 0;    //keep record of which cards to change for player when hit is selected
    static int dealerCount = 0;    //keep record of which cards to change for dealer when dealer hits
    static int win = 0;     //keeps record of wins  (JV 10/01/10)
    static int lose = 0;    //keeps record of loss  (JV 10/01/10)
    static int hit = 0;     //let's engine know if hit button was selected (0 means it has not)
    static int stand = 0;    //let's engine know if stand button was selected (0 means it has not)
    static int playerTotal = 0; //tells player's total (JV 10/01/10)
    static int dealerTotal = 0; //tells dealer's total (JV 10/01/10)
    static int playerTurn = 0;  //activates buttons so that they do actions when clicked (as it's players turn)
    static int startGame = 0; //starts the game when the start game button is pressed
    TextView TextDealer;
    RemoteViews name = new RemoteViews("edu.sju.BlackJack", R.layout.play_screen);


public void run() {
    name.setTextViewText(R.id.Dealer_Total, "0");
    //main();
}

public void setView(TextView a)
{
TextDealer = a;
}

public void setGameStart(int i)
{
    startGame = i;
}

public void gameHit(int i)
{
    if(playerTurn == 1)
    hit = 1;
}

public void gameStand(int i)
{
    if(playerTurn == 1)
    stand = 1;
}


public void main()

    {//Start Game
        Deck mainDeck = new Deck();
        fillDeck(mainDeck);

        //TextView TextPlayer =  (TextView)findViewById(R.id.Player_Total); 
        //TextDealer.setText("" + dealerTotal);
        //TextPlayer.setText("" + playerTotal);

        while(true)
        {
            if(startGame == 1)
            {

                if(mainDeck.getList().size() < 15){
                    mainDeck = emptyDeck();
                    fillDeck(mainDeck);
                    }  

                //RESET CARD VIEWS TO DEFAULT
                //RESET DEALERCARD AND PLAYERCARD TOTALS TO 0
                dealerTotal = 0;
                playerTotal = 0;
                playerCount = 0;
                dealerCount = 0;

                //playHand(mainDeck);

            }
        }

    }
  • 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-05-18T05:08:42+00:00Added an answer on May 18, 2026 at 5:08 am

    Whatever your problem is, I don’t think it is what you think it is. If your layout is appearing in the app widget, then the package name is being handled properly. If the update (your setTextViewText() call) is not having an effect, then either R.layout.play_screen does not have R.id.Dealer_Total or you are not sending over a RemoteViews that contains the setTextViewText() instructions.

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

Sidebar

Related Questions

Doing code analysis of the project and get the message Reference-counted object is used
I want to do something: http://astro.unl.edu/naap/hr/animations/hrExplorer.html This example is in Flash but I'm doing
Doing a little search i realized that to make an equalizer. I need to
Doing some profiling (mem & speed) I've been stomped by the fact that win7
Doing some SOAP calls to a 3rd party application. They provide this soap header
Doing the getting started of Sinatra. I get this error: ./sinatra.rb:5: undefined method `get'
Doing an ajax get request works as expected using the following code: $.ajax({ type:
Doing my first SL4 MVVM RIA based application and i ran into the following
Doing the below will reproduce my problem: New WPF Project Add ListView Name the
Doing my first tryouts with foreign keys in a mySQL database and are trying

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.