StorageBrowserpublic class StorageBrowser extends android.app.ListActivity A list view displaying all storage units on a device. |
Fields Summary |
---|
private static final String | TAG | private MtpClient | mClient | private String | mDeviceName | private List | mStorageList | private DeviceDisconnectedReceiver | mDisconnectedReceiver |
Methods Summary |
---|
protected void | onCreate(android.os.Bundle savedInstanceState)
super.onCreate(savedInstanceState);
mClient = ((CameraBrowserApplication)getApplication()).getMtpClient();
mDeviceName = getIntent().getStringExtra("device");
mDisconnectedReceiver = new DeviceDisconnectedReceiver(this, mDeviceName);
| protected void | onDestroy()
unregisterReceiver(mDisconnectedReceiver);
super.onDestroy();
| protected void | onListItemClick(android.widget.ListView l, android.view.View v, int position, long id)
Intent intent = new Intent(this, ObjectBrowser.class);
intent.putExtra("device", mDeviceName);
intent.putExtra("storage", mStorageList.get(position).getStorageId());
startActivity(intent);
| protected void | onResume()
super.onResume();
mStorageList = mClient.getStorageList(mDeviceName);
setListAdapter(new StorageAdapter(this));
|
|