layout doesn't always load
<p>I redesigned my project by simplifying the code programming. i placed all the images that are static through the xml layout.</p>

<p>i get only 2 results when i run the program.</p>

<p>1) running with no problems</p>

<p><a href="https://i.stack.imgur.com/b59j4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b59j4.jpg" alt="enter image description here"></a></p>

<p>2) running with problems</p>

<p><a href="https://i.stack.imgur.com/fkCxu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fkCxu.jpg" alt="enter image description here"></a></p>

<p>i get the following error:</p>

<pre><code>Connected to process 10651 on device 4.7_WXGA_API_22 [emulator-5554]
I/art: Not late-enabling -Xcheck:jni (already on)
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
</code></pre>

<p>I believe the problem lies somewhere in this inner class, i think?!</p>

<pre><code> private class MatchCardGame{

    private Game mMatchGame;

    private List&lt;Drawable&gt; revealImagesOfCards;
    private List&lt;Integer&gt; revealCards;
    private Drawable hiddenCard;
    private List&lt;Integer&gt; cardPoints;
    private List&lt; Boolean&gt; isHidden;

    public MatchCardGame(int numOfCards){

        mMatchGame = new Game(numOfCards);
        revealImagesOfCards = new ArrayList&lt;&gt;();
        revealCards = new ArrayList&lt;&gt;();
        cardPoints = new ArrayList&lt;&gt;();
        isHidden = new ArrayList&lt;&gt;();

        setCoverCard();

        for(int i = 1; i &lt;= numOfCards; i++)
            setMatchImageCard(i);

    }
    public void setMatchImageCard( int cardLoc){

        int drawableLoc =  mMatchGame.findImageOfCard(cardLoc);
       Drawable drawable = ResourcesCompat.getDrawable(getResources(), drawableLoc, null);
        Integer revealCard = mMatchGame.findContentsOfCard(cardLoc);

        revealImagesOfCards.add(drawable);
        revealCards.add(revealCard);
        cardPoints.add(Integer.valueOf(20));
        Boolean hideCard = true;
        isHidden.add(hideCard);

    }
    private void setCoverCard(){
        hiddenCard = ResourcesCompat.getDrawable(getResources(), R.drawable.black_card, null);
    }

    public Drawable getImage(int loc, boolean statReveal){
        loc--;
        if(!statReveal){
            Boolean hideCard = isHidden.get(loc);
            hideCard = true;
            return hiddenCard;
        }
        else {
            Boolean hideCard = isHidden.get(loc);
            hideCard = false;
            return revealImagesOfCards.get(loc);
        }



    }

    public boolean getHiddenStat(int loc){
        loc--;
        Boolean hideCard = isHidden.get(loc);
        return  hideCard;
    }

    public boolean compareCards(int loc1, int loc2){
        loc1--;
        loc2--;

        Integer card1 = revealCards.get(loc1);
        Integer card2 = revealCards.get(loc2);
        Integer cardPts1 = cardPoints.get(loc1);
        Integer cardPts2 = cardPoints.get(loc2);


        if(card1 == card2){

            int num = Integer.valueOf( scoreText.getText().toString());

            Log.i("TAGG","Score Points: " + (cardPts1 + cardPts2));
            new AdjustScore().execute(Integer.valueOf(cardPts1 + cardPts2));


            return true;
        }

        else{


            cardPts1 -= 5;
            cardPts2 -= 5;


            if(cardPts1 &lt; 0)
                cardPts1 = 0;

            if(cardPts2 &lt; 0)
                cardPts2 = 0;

            cardPoints.set(loc1, cardPts1);
            cardPoints.set(loc2,cardPts2);

            return false;
        }


    }

    private class AdjustScore extends AsyncTask&lt;Integer,Integer,Void&gt;{

        private TextView scoreText;
        private int currentScore;
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            scoreText = (TextView) findViewById(R.id.score_txt);
            currentScore = Integer.valueOf( scoreText.getText().toString());
        }

        @Override
        protected Void doInBackground(Integer... integers) {
          final  int num = integers[0];

            Runnable runnable = new Runnable() {
                @Override
                public void run() {

            for (int x = 1; x &lt;= num; x++){


                        try {
                            Thread.sleep(20);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }

                      publishProgress(Integer.valueOf(currentScore + x));
                    }


            }
        };
        new Thread(runnable).start();

        return null;
        }

        @Override
        protected void onProgressUpdate(Integer... values) {
            Message msg = scoreHandler.obtainMessage();
            Bundle bundle = new Bundle();
            bundle.putString("myPoints",String.valueOf(values[0]));



            msg.setData(bundle);
            scoreHandler.sendMessage(msg);

        }
    }


}
</code></pre>

<p>I call this in onCreate of activity</p>

<pre><code>private MatchCardGame myGame;
private List&lt;Integer&gt; selectCards;
private TextView scoreText;

private Handler scoreHandler = new Handler(){

    @Override
    public void handleMessage(Message msg) {

        Bundle bundle = msg.getData();
        String stat1 = bundle.getString("myPoints");

        int num = Integer.valueOf(stat1);


        scoreText.setText(String.valueOf(num));


    }


};
@Override
protected void onCreate( Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_card_game);

    myGame = new MatchCardGame(12);
}
</code></pre>

<p>I have another inner class derived from AsynTask.
it is mainly used to setup the card views and set clicklisteners on imageviews. but i don't think it is the problem.</p>