Home > Mobile >  Call on intents. ACTION_VIEW gallery opened the pictures amplification
Call on intents. ACTION_VIEW gallery opened the pictures amplification

Time:04-28

Project has a picture gallery opened, you need to call system project is based on the research and development of tablet, support zoom browsing, the code is as follows:
The File File=new File (data. Wjpath);
Intent Intent=new Intent (Intent. ACTION_VIEW);
Intent. SetFlags (intent. FLAG_ACTIVITY_NEW_TASK);
If (Build) VERSION) SDK_INT & gt;=Build. VERSION_CODES. N) {
Intent. SetFlags (intent. FLAG_GRANT_READ_URI_PERMISSION);
Uri Uri=FileProvider. GetUriForFile (getActivity (), getActivity (), getPackageName () + ". The provider ", the file).
Intent. SetDataAndType (uri, "image/jpeg");
} else {
Intent. SetDataAndType (Uri) fromFile (file), "image/jpeg");
}
startActivity(intent);
Model above 7.0 open and there is no problem, but only can enlarge a little bit about the amplification, but the same picture gallery opened directly in system can be magnified many very meticulous, have bosses, know how to solve this problem is set parameters control in the Intent

CodePudding user response:

Part type or can be amplified to very meticulous, some gallery can magnify the very detailed app call only slightly enlarged, have to analysis the reason, give point may lead to the direction of the proposal
  • Related