android:clickable = true makes layout not clickable?

by dxw_es » Sat, 10 Jul 2010 02:01:19 GMT


Sponsored Links
 Hey everyone..... I noticed something odd. I have a listview with
custom BaseAdapter, and getView() inflates a layout. On 1.6 SDK (I've
been developing on a G1), if I set android:clickable="true" on the
layout, then the item is NOT clickable (but otherwise the item is
clickable). Is this the correct behavior? It seems backwards to me.

Furthermore, no matter now matter how i set android:clickable for the
same layouts using 2.2 SDK (run using emulator), the layout always is
clickable... eh? I'm really bothered by this.

--



android:clickable = true makes layout not clickable?

by Matt » Sat, 10 Jul 2010 04:58:33 GMT


 How do you know it isn't clickable?  Did you try adding an onClick
listener?

Just because a view is clickable, does NOT mean it will change
background colors when clicked.  You have to use <state> to change the
backgrounds when something is focused, pressed, etc.

-Matt




--


Sponsored Links


Other Threads

1. Learning Porting

Hi,
   Can any of you suggest me on how to learn 'porting android'? Is there any
books that I have to read before I begin one.
regards,
chetan

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. IllegalArgumentException calling Surface.unlockCanvasAndPost ?

Hi All,

In my app, I have the following code (see below). In the market, under
Errors, I see that the following exception was reported:
java.lang.IllegalArgumentException
at android.view.Surface.unlockCanvasAndPost(Native Method)
at
com.android.internal.view.BaseSurfaceHolder.unlockCanvasAndPost(BaseSurfaceHolder.java:
179)
at
com.sandroids.wallpapers.photos.RendererThread.run(RendererThread.java:
178)

Looking at android's code, I could not understand what could go wrong,
as apparently unlocalCancasAndPost of Surface class, which is called
by BaseSurfaceHolder 179 is native.

Can anyone help?


while (run) {
      long currentTime = System.currentTimeMillis();

      try {
        c = surfaceHolder.lockCanvas(null);
        if (c != null) {
          synchronized (this.surfaceHolder) {
            update(c, currentTime);
          }
        }
      } finally {
        if (c != null) {
          this.surfaceHolder.unlockCanvasAndPost(c);
        }
      }

      synchronized (this) {
        if (wait) {
          try {
            wait();
          } catch (Exception e) {
          }
        }
      }
    }

-- 

3. Communication between service and activity in Android

4. Application that refershese imgView with image from internet

5. Serveral questions regarding bluetooth-stack (Handsfree UUIDs SPP Headset)

6. What is Gdi and Why Should You Care?

7. How to pass a String from an activity to a service