-1

問題をキャッチできませんでした。見つけたら教えてください。テキストビューはクリックを処理していますが、ドローアブルはnullではありませんが、画像は表示されていません

strengthtv = (TextView) findViewById(R.id.strengthtv);
strengthtv.setOnClickListener(strengthivListener);

performancetv = (TextView) findViewById(R.id.performancetv);
performancetv.setOnClickListener(performanceivListener);

shapetv = (TextView) findViewById(R.id.shapetv);
shapetv.setOnClickListener(shapeivListener);

...

switch (Prefs.PRODUCT) {
            case Prefs.APP_HC:
                Drawable strengthhc = resources.getDrawable(R.drawable.btn_goals_focus_bal_hc_2x_s);
                Drawable perfhc = resources.getDrawable(R.drawable.icon_goals_performance_hc_2);
                Drawable shapehc = resources.getDrawable(R.drawable.icon_goals_shape_hc_2x);

                Log.v("setgoals", " drawables------> " +  strengthhc + " -- "+ perfhc + " -- "+ shapehc);
                strengthtv.setCompoundDrawables(null, strengthhc, null, null);
                performancetv.setCompoundDrawables(null, perfhc, null, null);
                shapetv.setCompoundDrawables(null, shapehc, null, null);

                break;
            case Prefs.APP_BF:
                Drawable strengthbf = resources.getDrawable(R.drawable.btn_goals_focus_bal_bf_2x_s);
                Drawable perfbf = resources.getDrawable(R.drawable.icon_goals_performance_bf_2);
                Drawable shapebf = resources.getDrawable(R.drawable.icon_goals_shape_bf_2x);

                Log.v("setgoals", " drawables------> " +  strengthbf + " -- "+ perfbf + " -- "+ shapebf);
                strengthtv.setCompoundDrawables(null, strengthbf, null, null);
                performancetv.setCompoundDrawables(null, perfbf, null, null);
                shapetv.setCompoundDrawables(null, shapebf, null, null);

                break;
            }
4

1 に答える 1