Try ll.invalidate() -- Jack Ha Open Source Development Center ・T・ ・ ・Mobile・ stick together
The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Sep 16, 9:22 pm, siliconeagle <rrmu...@gmail.com> wrote: > I have a linearLayout which is focusable, so I can use it with the > trackball, when focused i want to change the background to a different > drawable - but it looks like the view needs refreshing/redrawing > somehow. I know it gets focus as the imageView state changes when i > move the trackball. > > anyone know how to trigger the linearLayout(ll) to refresh? > > code below: > > llv.setFocusable(true); > llv.setOnFocusChangeListener(new OnFocusChangeListener() { > @Override > public void onFocusChange(View v, boolean hasFocus) { > ImageView > lh_img=(ImageView)v.findViewById(R.id.lh_img); > LinearLayout ll = (LinearLayout)v; > if (hasFocus) { > > ll.setBackgroundResource(R.drawable.bg_listsel); > lh_img.setPressed(true); > } else { > > ll.setBackgroundResource(R.drawable.bg_header); > lh_img.setPressed(false); > } > //ll.getParent().recomputeViewAttributes(ll); > // need to trigger the ll view torefresh somehow. > } > > }); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---