FileDocCategorySizeDatePackage
UsageStats.javaAPI DocAndroid 1.5 API9545Wed May 06 22:42:48 BST 2009com.android.settings

UsageStats

public class UsageStats extends android.app.Activity implements android.widget.AdapterView.OnItemSelectedListener
Activity to display package usage statistics.

Fields Summary
private static final String
TAG
private static final boolean
localLOGV
private android.widget.Spinner
mTypeSpinner
private android.widget.ListView
mListView
private com.android.internal.app.IUsageStats
mUsageStatsService
private android.view.LayoutInflater
mInflater
private UsageStatsAdapter
mAdapter
private android.content.pm.PackageManager
mPm
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle icicle)
Called when the activity is first created.

        super.onCreate(icicle);
        mUsageStatsService = IUsageStats.Stub.asInterface(ServiceManager.getService("usagestats"));
        if (mUsageStatsService == null) {
            Log.e(TAG, "Failed to retrieve usagestats service");
            return;
        }
        mInflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mPm = getPackageManager();
        
        setContentView(R.layout.usage_stats);
        mTypeSpinner = (Spinner) findViewById(R.id.typeSpinner);
        mTypeSpinner.setOnItemSelectedListener(this);
        
        mListView = (ListView) findViewById(R.id.pkg_list);
        // Initialize the inflater
        
        mAdapter = new UsageStatsAdapter();
        mListView.setAdapter(mAdapter);
    
public voidonItemSelected(android.widget.AdapterView parent, android.view.View view, int position, long id)

        mAdapter.sortList(position);
    
public voidonNothingSelected(android.widget.AdapterView parent)

        // do nothing