@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_distribute); initData(); initViews(); setListeners(); }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == 10) { if (resultCode == 10) { String executors = data.getStringExtra("executors"); subordinates = data.getParcelableArrayListExtra("subordinates"); tv_executor.setText(executors); } } if (requestCode == 20) { if (resultCode == 20) { imageUrls.clear(); picUrls.clear(); ArrayList<PicUrl> imageUrlList = data.getParcelableArrayListExtra("picUrls"); imageUrls.addAll(imageUrlList); for (PicUrl picUrl : imageUrls) { if (picUrl.isCheck()) { picUrls.add(picUrl); } } PicUrl picUrl = new PicUrl(); picUrls.add(picUrl); Log.e("pic", picUrls.size() + ""); Log.e("image", imageUrls.size() + ""); adapter.notifyDataSetChanged(); } } if (requestCode == 30) { if (resultCode == RESULT_OK) { Uri recordUri = data.getData(); Log.e("recordUri", recordUri.toString()); String path; if (recordUri.toString().split(":")[0].equals("content")) { path = VoiceUtil.getMediaStoreVideoPath(this, recordUri); } else { path = recordUri.toString().split(":")[1].substring(2); } String fileName = path.substring(path.lastIndexOf("/") + 1); Log.e("path", path); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time = sdf.format(new Date(System.currentTimeMillis())); tv_record.setText(time + "." + fileName.split("\\.")[1]); recordFile = new File(path); tv_delRecord.setVisibility(View.VISIBLE); } } }
@Override protected void onDestroy() { stopService(imageIntent); unregisterReceiver(mBroadcastReceiver); super.onDestroy(); }