Scenario Description: For example, you open the system camera in the application, and then you need to automatically close the system camera after a few minutes (not manually closed)
1. Using Startactivityforresult (Intent,requestcode) in Activitya,
2. In Activitya, the new Timer (), finishactivity (Requestcode) after delay can automatically turn off the system camera
3. If you are startactivityforresult in fragment, you need to modify it to getactivity (). Startactivityforresult ()
4. Finishactivity (Requestcode) corresponding to the activity
5. In the activity's Onactivityresult, use Fragment f = Getfragmentmanager (). Findfragmentbyid (R.id.layoutid);
6. After check fragment is null, execute Fragment.onactivityresult () and pass result to fragment level processing.
Android How the Finish app opens through Startactivityforresult activity