Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Intent intent1 = new Intent(context,CwacCamActivity.class);
- intent1.setAction(GlobalVariables.TAKE_VIDEO_ACTION);
- intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- intent1.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);//have tried without including this too.
- context.startActivity(intent1);
- public void autoFocusAvailable()
- try {
- record();
- } catch (Exception e) {
- e.printStackTrace();
- }
- //THread to stop the video after stipulated time ( 5 seconds for example)...
- new Thread(new Runnable() {
- @Override
- public void run() {
- //RUnnable to let the record go on for the requested time...
- try {
- Thread.sleep(5000);
- getActivity().runOnUiThread(new Runnable() {
- @Override
- public void run() {
- try {
- stopRecording();
- getActivity().finish();
- } catch (IOException e) {
- e.printStackTrace();
- Log.v(GlobalVariables.TAG,"error is"+e.getMessage());
- }
- }
- });
- } catch (Exception e) {
- Log.v(GlobalVariables.TAG,"error is"+e.getMessage()
- }
- }
- }).start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement