FileDocCategorySizeDatePackage
ListThrasher.javaAPI DocAndroid 5.1 API3669Thu Mar 12 22:22:12 GMT 2015android.widget.listview

ListThrasher

public class ListThrasher extends android.app.ListActivity implements AdapterView.OnItemSelectedListener
Exercises change notification in a list

Fields Summary
android.os.Handler
mHandler
ThrashListAdapter
mAdapter
Random
mRandomizer
android.widget.TextView
mText
Runnable
mThrash
Constructors Summary
Methods Summary
public voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);

        setContentView(R.layout.list_thrasher);

        mText = (TextView) findViewById(R.id.text);
        mAdapter = new ThrashListAdapter(this);
        setListAdapter(mAdapter);

        mHandler.postDelayed(mThrash, 5000);

        getListView().setOnItemSelectedListener(this);
    
public voidonItemSelected(android.widget.AdapterView parent, android.view.View v, int position, long id)

        mText.setText("Position " + position);
    
public voidonNothingSelected(android.widget.AdapterView parent)

        mText.setText("Nothing");