|
@@ -13,6 +13,7 @@ import android.content.pm.PackageManager;
|
|
|
import android.location.LocationManager;
|
|
|
import android.os.Build;
|
|
|
import android.os.Environment;
|
|
|
+import android.os.Handler;
|
|
|
import android.provider.MediaStore;
|
|
|
import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
@@ -252,6 +253,18 @@ public class MainActivity extends BaseActivity {
|
|
|
public void onClick(View v) {
|
|
|
Log.e("-------->","------->path="+getImagePath("123.jpg"));
|
|
|
savePicture(new File(getImagePath("123.jpg")), "ceshi", "202119");
|
|
|
+// new Handler().postDelayed(new Runnable() {
|
|
|
+// @Override
|
|
|
+// public void run() {
|
|
|
+// savePicture(new File(getImagePath("234.jpg")), "ceshi", "202119");
|
|
|
+// }
|
|
|
+// }, 20000);
|
|
|
+// new Handler().postDelayed(new Runnable() {
|
|
|
+// @Override
|
|
|
+// public void run() {
|
|
|
+// savePicture(new File(getImagePath("345.jpg")), "ceshi", "202119");
|
|
|
+// }
|
|
|
+// }, 30000);
|
|
|
// startActivity(new Intent(MainActivity.this, CaremaActivity.class));
|
|
|
}
|
|
|
});
|
|
@@ -428,12 +441,16 @@ public class MainActivity extends BaseActivity {
|
|
|
Log.i("--------->", "-------->cpu核心数" + numberOfCores);
|
|
|
fixedThreadPool = Executors.newFixedThreadPool(2*numberOfCores+1);
|
|
|
}
|
|
|
- fixedThreadPool.execute(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- ApiHelper.uploadPicture(MainActivity.this, file, path, name);
|
|
|
- }
|
|
|
- });
|
|
|
+ try {
|
|
|
+ fixedThreadPool.execute(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ ApiHelper.uploadPicture(MainActivity.this, file, path, name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void checkNet() {
|