This commit is contained in:
2021-03-09 17:40:00 +08:00
parent 1fe96ef22a
commit 092181c088
10 changed files with 323 additions and 123 deletions

View File

@@ -45,6 +45,7 @@ public class SelectPicDanimicActivity extends Activity implements OnClickListene
private int photeid;
private boolean crop;//裁剪
private int cropx, cropy;//裁剪的高和宽
private int entertype=1;//
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -101,22 +102,23 @@ public class SelectPicDanimicActivity extends Activity implements OnClickListene
crop = getIntent().getBooleanExtra("crop", false);
cropx = getIntent().getIntExtra("cropx", 1);
cropy = getIntent().getIntExtra("cropy", 2);
entertype = getIntent().getIntExtra("entertype", 1);
fileolod = Environment.getExternalStorageDirectory().getPath() + string + filelodother;
break;
}
try {
if(entertype==100){
try {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri
.fromFile(new File(fileolod)));
startActivityForResult(intent, 1);
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri
.fromFile(new File(fileolod)));
startActivityForResult(intent, 1);
//拍照我们用Action为MediaStore.ACTION_IMAGE_CAPTURE
//有些人使用其他的Action但我发现在有些机子中会出问题所以优先选择这个
//拍照我们用Action为MediaStore.ACTION_IMAGE_CAPTURE
//有些人使用其他的Action但我发现在有些机子中会出问题所以优先选择这个
/* Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
@@ -124,10 +126,10 @@ public class SelectPicDanimicActivity extends Activity implements OnClickListene
Environment.getExternalStorageDirectory(), "temp.jpg")));
System.out.println("=============" + Environment.getExternalStorageDirectory());*/
} catch (Exception e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
}