简体   繁体   中英

What is the class for the intent with action = “MediaStore.ACTION_IMAGE_CAPTURE”?

I have an activity that starts another activity for result in this way:

Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File f = new File(CAMERA_PATH_TEMP); cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f)); startActivityForResult(cameraIntent, REQUEST_CODE_CAMERA);

to test this activity, I want to use
"Instrumentation.ActivityMonitor(IntentFilter which, Instrumentation.ActivityResult result, boolean block)"
or
"Instrumentation.ActivityMonitor(String cls, Instrumentation.ActivityResult result, boolean block)"
but I don't know what should I pass as cameraIntent's class or how to use IntentFilter for this.

Check out the Android developer docs for Instrumentation.ActivityMonitor . It explains what each of the variables are used for.

For the IntentFilter constructor, the filter is the set of intents this monitor is responsible for.

For the String constructor, the String is the activity class this monitor is responsible for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM