FileDocCategorySizeDatePackage
CameraBrowser.javaAPI DocAndroid 5.1 API4354Thu Mar 12 22:22:30 GMT 2015com.android.camerabrowser

CameraBrowser

public class CameraBrowser extends android.app.ListActivity implements MtpClient.Listener
A list view displaying all connected cameras.

Fields Summary
private static final String
TAG
private MtpClient
mClient
private List
mDeviceList
private static final int
MODEL_COLUMN
private static final int
MANUFACTURER_COLUMN
private static final int
COLUMN_COUNT
Constructors Summary
Methods Summary
public voiddeviceAdded(android.mtp.MtpDevice device)

        Log.d(TAG, "deviceAdded: " + device.getDeviceName());
        mDeviceList = mClient.getDeviceList();
        reload();
    
public voiddeviceRemoved(android.mtp.MtpDevice device)

        Log.d(TAG, "deviceRemoved: " + device.getDeviceName());
        mDeviceList = mClient.getDeviceList();
        reload();
    
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);
        mClient = ((CameraBrowserApplication)getApplication()).getMtpClient();
        mClient.addListener(this);
        mDeviceList = mClient.getDeviceList();
    
protected voidonDestroy()

        mClient.removeListener(this);
        super.onDestroy();
    
protected voidonListItemClick(android.widget.ListView l, android.view.View v, int position, long id)

        Intent intent = new Intent(this, StorageBrowser.class);
        intent.putExtra("device", mDeviceList.get(position).getDeviceName());
        startActivity(intent);
    
protected voidonResume()

        super.onResume();
        reload();
    
private voidreload()

        setListAdapter(new CameraAdapter(this));