Setting clickable on individual ListView's ChildViews

by chiizuf...@googlemail.com » Wed, 04 Mar 2009 23:50:16 GMT


Sponsored Links
 Hi,

I'm in a situation where I have a ListView in which I want some of the
entries to be clickable and some not to be. Setting
listView.setClickable(false) disables clicks on everything even if
textView.setClickable(true) is set when the child view is being added
in my customised ArrayAdapter. Conversely, leaving clickableness of a
ListView at the default of true, textView.setClickable(false) doesn't
work.

I've tried:

textView.setClickable(false);
textView.setFocusable(false);
textView.setFocusableInTouchMode(false);
textView.setLinksClickable(false);
textView.setLongClickable(false);
parent.setClickable(false);
parent.setFocusable(false);
parent.setFocusableInTouchMode(false);
parent.setLongClickable(false);

but none of them have any effect.

The issue at
 http://code.google.com/p/android/issues/detail?id=625& ;can=1&q=clickable&colspec=ID%20Type%20Version%20Security%20Status%20Owner%20Summary
notes that clicks don't go to the child view in a ListView. This being
the case, is it even possible to disable clicks for an individual
element which isn't a header?

Thanks =].

--~--~---------~--~----~------------~-------~--~----~



Setting clickable on individual ListView's ChildViews

by chiizuf...@googlemail.com » Thu, 05 Mar 2009 18:40:33 GMT


 Thanks for your reply,

What do you mean by disable the items in my adapter?




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Setting clickable on individual ListView's ChildViews

by chiizuf...@googlemail.com » Fri, 06 Mar 2009 18:13:48 GMT


 Aha, figured it out. By overriding isEnabled in my adapter I can check
whether a certain position should be clickable or not.

Thanks! :D

Open source is fun... :D

On Mar 5, 10:40am, "chiizuf...@googlemail.com"




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Update sold Wts milestone murmer

Sold ke surabaya  yg japri paling cepet dan syaratnya terpenuhi
Smp ketemu besok mr. N. ...

si miley numpak si lemot @asyik aja......




Selamat sore mods

Karena sudah bosan , mau di jual saja motorola milestone
Kondisi
Body msh mulus
Ada beset di ujung tutup batt
Tombol kamera agak pudar cromenya

Over all msh baguslah ...
Eclair 2.1 official update ota
Sudah terbungkus otter box cummuter
Cuma ada
Hp + batt  +mc 8 G +otter box commuter

Kalau mau sekalian xl unlimited
150rb/ bulan fu 1 G

Posisi sekarang di mataram besok sore surabaya dan
berharap bisa ketemuan di malang nih besok sabtu , jd enak ngelihat nya
memang  msh mulus he..he...

Harga nett
3,2 jt
3,3 jt + xl unlimited

Salam

Japri
putu_s1...@yahoo.com



Miley numpak si lemot,
nikmatin aje

-- 
"Indonesian Android Community [id-android]" 

2. Need Help: Can't play multiple sounds simultaneously with SoundPool

I am unable to use the following to code to play multiple sounds/beeps
simultaneously. In my onclicklistener I have added ... public void
onClick(View v) { mSoundManager.playSound(1);
mSoundManager.playSound(2); } ... But this plays only one sound at a
time, sound with index 1 followed by sound with index 2.

How can I play atleast 2 sounds simultaneously using this code
whenever there is an onClick() event?

public class SoundManager {

private  SoundPool mSoundPool;
private  HashMap<Integer, Integer> mSoundPoolMap;
private  AudioManager  mAudioManager;
private  Context mContext;


public SoundManager()
{

}

public void initSounds(Context theContext) {
     mContext = theContext;
     mSoundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);
     mSoundPoolMap = new HashMap<Integer, Integer>();
     mAudioManager =
(AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);
}

public void addSound(int Index,int SoundID)
{
    mSoundPoolMap.put(1, mSoundPool.load(mContext, SoundID, 1));
}

public void playSound(int index) {

     int streamVolume =
mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
     mSoundPool.play(mSoundPoolMap.get(index), streamVolume,
streamVolume, 1, 0, 1f);
}

public void playLoopedSound(int index) {

     int streamVolume =
mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
     mSoundPool.play(mSoundPoolMap.get(index), streamVolume,
streamVolume, 1, -1, 1f);
}

-- 

3. Rotate emulator screen through ADB shell

4. Worthed Mana Droid Atau XT800

5. HTC Incredible, unified media content provider for internal/external storage

6. (ASK) Aplikasi keep alive?

7. Question: Environment.getExternalStorageDirectory() on HTC Incredible. What is the return value?