0

I used android 7.1.1(API 25) Build-tools before and the version has been upgraded to 8.1.0(API 27) a few days ago...

But now using android 9.0(API 28) and the device is also.

Image Crop function is not working and I can't even load image through HTTP I need your advice... please help me(;_;)

I'm trying Lib but I don't use gradle and I'm using java 1.6

public void imageForCrop(String imagePath){
   Uri imageUri = Uri.parse(imagePath);
   Intent intent = new Intent("com.android.camera.action.CROP");
   intent.setDataAndType(imageUri, "image/*");
   String path = imageUri.getPath();
   path =  path.substring(path.lastIndexOf("/"),path.lastIndexOf("."))+"_new.jpg";
   imageUri =Uri.fromFile(new File(Environment.getExternalStorageDirectory().getAbsolutePath(), path));
   intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
   intent.putExtra("scale", true);
   intent.putExtra("return-data", true);
   callerObject.startActivityForResult(intent, IMAGE_FOR_CROP);
}
aminography
  • 21,986
  • 13
  • 70
  • 74
이승현
  • 1
  • 3

1 Answers1

0

Maybe HTTP request don't enable in Android 8 & 9.

The easy way to implement this is to use this attribute to your AndroidManifest.xml where you allow all http for all requests:

android:usesCleartextTraffic="true"
ngdathd
  • 23
  • 4
  • I found a good answer for HTTP request in Android 8, 9. **Try** [link](https://stackoverflow.com/questions/51902629/how-to-allow-all-network-connection-types-http-and-https-in-android-9-pie) – ngdathd Sep 27 '19 at 04:53
  • I'm tried 'network_security_config.xml' and Download image but it's not working T_T – 이승현 Sep 27 '19 at 05:40