FileDocCategorySizeDatePackage
GridThrasher.javaAPI DocAndroid 5.1 API3825Thu Mar 12 22:22:12 GMT 2015android.widget.gridview

GridThrasher

public class GridThrasher extends android.app.Activity 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.grid_thrasher);
        
        mText = (TextView) findViewById(R.id.text);
        mAdapter = new ThrashListAdapter(this);
        GridView g = (GridView) findViewById(R.id.grid);
        g.setAdapter(mAdapter);
        
        mHandler.postDelayed(mThrash, 5000);
        
        g.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");