Search in sources :

Example 6 with MediaScannerConnection

use of android.media.MediaScannerConnection in project android_frameworks_base by AOSPA.

the class ObjectViewer method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mClient = ((CameraBrowserApplication) getApplication()).getMtpClient();
    setContentView(R.layout.object_info);
    mImportButton = (Button) findViewById(R.id.import_button);
    mImportButton.setOnClickListener(this);
    mDeleteButton = (Button) findViewById(R.id.delete_button);
    mDeleteButton.setOnClickListener(this);
    mDeviceName = getIntent().getStringExtra("device");
    mStorageID = getIntent().getIntExtra("storage", 0);
    mObjectID = getIntent().getIntExtra("object", 0);
    mDisconnectedReceiver = new DeviceDisconnectedReceiver(this, mDeviceName);
    mScannerClient = new ScannerClient(this);
    mScannerConnection = new MediaScannerConnection(this, mScannerClient);
}
Also used : MediaScannerConnection(android.media.MediaScannerConnection)

Example 7 with MediaScannerConnection

use of android.media.MediaScannerConnection in project Shuttle by timusus.

the class CustomMediaScanner method scanFiles.

public static void scanFiles(List<String> paths, @Nullable ScanCompletionListener listener) {
    CustomMediaScanner client = new CustomMediaScanner(paths, listener);
    MediaScannerConnection connection = new MediaScannerConnection(ShuttleApplication.getInstance(), client);
    client.connection = connection;
    connection.connect();
}
Also used : MediaScannerConnection(android.media.MediaScannerConnection)

Example 8 with MediaScannerConnection

use of android.media.MediaScannerConnection in project android_frameworks_base by ParanoidAndroid.

the class ObjectViewer method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mClient = ((CameraBrowserApplication) getApplication()).getMtpClient();
    setContentView(R.layout.object_info);
    mImportButton = (Button) findViewById(R.id.import_button);
    mImportButton.setOnClickListener(this);
    mDeleteButton = (Button) findViewById(R.id.delete_button);
    mDeleteButton.setOnClickListener(this);
    mDeviceName = getIntent().getStringExtra("device");
    mStorageID = getIntent().getIntExtra("storage", 0);
    mObjectID = getIntent().getIntExtra("object", 0);
    mDisconnectedReceiver = new DeviceDisconnectedReceiver(this, mDeviceName);
    mScannerClient = new ScannerClient(this);
    mScannerConnection = new MediaScannerConnection(this, mScannerClient);
}
Also used : MediaScannerConnection(android.media.MediaScannerConnection)

Example 9 with MediaScannerConnection

use of android.media.MediaScannerConnection in project platform_frameworks_base by android.

the class ObjectViewer method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mClient = ((CameraBrowserApplication) getApplication()).getMtpClient();
    setContentView(R.layout.object_info);
    mImportButton = (Button) findViewById(R.id.import_button);
    mImportButton.setOnClickListener(this);
    mDeleteButton = (Button) findViewById(R.id.delete_button);
    mDeleteButton.setOnClickListener(this);
    mDeviceName = getIntent().getStringExtra("device");
    mStorageID = getIntent().getIntExtra("storage", 0);
    mObjectID = getIntent().getIntExtra("object", 0);
    mDisconnectedReceiver = new DeviceDisconnectedReceiver(this, mDeviceName);
    mScannerClient = new ScannerClient(this);
    mScannerConnection = new MediaScannerConnection(this, mScannerClient);
}
Also used : MediaScannerConnection(android.media.MediaScannerConnection)

Example 10 with MediaScannerConnection

use of android.media.MediaScannerConnection in project android_frameworks_base by crdroidandroid.

the class ObjectViewer method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mClient = ((CameraBrowserApplication) getApplication()).getMtpClient();
    setContentView(R.layout.object_info);
    mImportButton = (Button) findViewById(R.id.import_button);
    mImportButton.setOnClickListener(this);
    mDeleteButton = (Button) findViewById(R.id.delete_button);
    mDeleteButton.setOnClickListener(this);
    mDeviceName = getIntent().getStringExtra("device");
    mStorageID = getIntent().getIntExtra("storage", 0);
    mObjectID = getIntent().getIntExtra("object", 0);
    mDisconnectedReceiver = new DeviceDisconnectedReceiver(this, mDeviceName);
    mScannerClient = new ScannerClient(this);
    mScannerConnection = new MediaScannerConnection(this, mScannerClient);
}
Also used : MediaScannerConnection(android.media.MediaScannerConnection)

Aggregations

MediaScannerConnection (android.media.MediaScannerConnection)10 Cursor (android.database.Cursor)1 Uri (android.net.Uri)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1