private void downloadMessage(final String locationUrl) { Log.d(TAG, "Downloading " + locationUrl); mSendStatusView.setText(getResources().getString(R.string.mms_status_downloading)); mSendButton.setEnabled(false); mRecipientsInput.setText(""); mSubjectInput.setText(""); mTextInput.setText(""); final String fileName = "download." + String.valueOf(Math.abs(mRandom.nextLong())) + ".dat"; mDownloadFile = new File(getCacheDir(), fileName); // Making RPC call in non-UI thread // AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() { // @Override // public void run() { // Uri contentUri = (new Uri.Builder()) // .authority("com.example.android.apis.os.MmsFileProvider") // .path(fileName) // .scheme(ContentResolver.SCHEME_CONTENT) // .build(); // final PendingIntent pendingIntent = PendingIntent.getBroadcast( // MmsMessagingDemo.this, 0, new Intent(ACTION_MMS_RECEIVED), 0); // SmsManager.getDefault().downloadMultimediaMessage(getApplicationContext(), // locationUrl, contentUri, null/*configOverrides*/, pendingIntent); // } // }); }
private void downloadMessage(final String locationUrl) { Log.d(TAG, "Downloading " + locationUrl); mSendStatusView.setText(getResources().getString(R.string.mms_status_downloading)); mSendButton.setEnabled(false); mRecipientsInput.setText(""); mSubjectInput.setText(""); mTextInput.setText(""); final String fileName = "download." + String.valueOf(Math.abs(mRandom.nextLong())) + ".dat"; mDownloadFile = new File(getCacheDir(), fileName); // Making RPC call in non-UI thread // AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() { // @Override // public void run() { // Uri contentUri = (new Uri.Builder()) // .authority("com.example.android.apis.os.MmsFileProvider") // .path(fileName) // .scheme(ContentResolver.SCHEME_CONTENT) // .build(); // final PendingIntent pendingIntent = PendingIntent.getBroadcast( // MmsMessagingDemo.this, 0, new Intent(ACTION_MMS_RECEIVED), 0); // SmsManager.getDefault().downloadMultimediaMessage(getApplicationContext(), // locationUrl, contentUri, null/*configOverrides*/, pendingIntent); // } // }); }
mSendButton.setEnabled(false); final String fileName = "send." + String.valueOf(Math.abs(mRandom.nextLong())) + ".dat"; mSendFile = new File(getCacheDir(), fileName);
mSendButton.setEnabled(false); final String fileName = "send." + String.valueOf(Math.abs(mRandom.nextLong())) + ".dat"; mSendFile = new File(getCacheDir(), fileName);