Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. Intent intent1 = new Intent(context,CwacCamActivity.class);
  2. intent1.setAction(GlobalVariables.TAKE_VIDEO_ACTION);
  3. intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  4. intent1.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);//have tried without including this too.
  5. context.startActivity(intent1);
  6.  
  7. public void autoFocusAvailable()
  8.  
  9. try {
  10. record();
  11. } catch (Exception e) {
  12. e.printStackTrace();
  13. }
  14.  
  15. //THread to stop the video after stipulated time ( 5 seconds for example)...
  16. new Thread(new Runnable() {
  17. @Override
  18. public void run() {
  19. //RUnnable to let the record go on for the requested time...
  20.  
  21. try {
  22. Thread.sleep(5000);
  23. getActivity().runOnUiThread(new Runnable() {
  24. @Override
  25. public void run() {
  26. try {
  27. stopRecording();
  28. getActivity().finish();
  29. } catch (IOException e) {
  30. e.printStackTrace();
  31. Log.v(GlobalVariables.TAG,"error is"+e.getMessage());
  32. }
  33. }
  34. });
  35. } catch (Exception e) {
  36. Log.v(GlobalVariables.TAG,"error is"+e.getMessage()
  37. }
  38. }
  39. }).start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement