Android Studio Build Encountered Problems?

Discussion in 'Buildbox General Discussion' started by wbddzyj, Feb 7, 2018.

  1. wbddzyj

    wbddzyj Boxer

    Joined:
    Dec 4, 2017
    Messages:
    7
    Likes Received:
    0
    I encountered an error using Android Studio build, so I tried to comment out the code below and successfully build successfully. Will the code below (which looks like screenshots) will have an impact on the game released? Thank you! @Andy



    PTServicesBridge.java

    //import android.R.id.content;

    private static Uri makeShareScreenshot() {
    // View rootView = PTServicesBridge.activity.getWindow().getDecorView().findViewById(android.R.id.content);
    // View screenView = rootView.getRootView();

    // screenView.setDrawingCacheEnabled(true);
    // Bitmap bitmap = Bitmap.createBitmap(screenView.getDrawingCache());
    // screenView.setDrawingCacheEnabled(false);

    // final static String dirPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Screenshots";
    //
    // File dir = new File(dirPath);
    // if (!dir.exists()) {
    // dir.mkdirs();
    // }
    //
    // File file = new File(dirPath, "share_screenshot.png");
    // try {
    // FileOutputStream stream = new FileOutputStream(file);
    // bitmap.compress(Bitmap.CompressFormat.PNG, 85, stream);
    // stream.flush();
    // stream.close();
    // }
    // catch (Exception e) {
    // //Print exception
    // Log.d(TAG, "Make Screenshot: Failed.");
    // e.printStackTrace();
    //
    // return Uri();
    // }

    // return Uri.fromFile(file);
    return null;
    }
     
  2. wbddzyj

    wbddzyj Boxer

    Joined:
    Dec 4, 2017
    Messages:
    7
    Likes Received:
    0
    Code:
    PTServicesBridge.java
    
    //import android.R.id.content;
    
    private static Uri makeShareScreenshot() {
    // View rootView = PTServicesBridge.activity.getWindow().getDecorView().findViewById(android.R.id.content);
    // View screenView = rootView.getRootView();
    
    // screenView.setDrawingCacheEnabled(true);
    // Bitmap bitmap = Bitmap.createBitmap(screenView.getDrawingCache());
    // screenView.setDrawingCacheEnabled(false);
    
    // final static String dirPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Screenshots";
    //
    // File dir = new File(dirPath);
    // if (!dir.exists()) {
    // dir.mkdirs();
    // }
    //
    // File file = new File(dirPath, "share_screenshot.png");
    // try {
    // FileOutputStream stream = new FileOutputStream(file);
    // bitmap.compress(Bitmap.CompressFormat.PNG, 85, stream);
    // stream.flush();
    // stream.close();
    // }
    // catch (Exception e) {
    // //Print exception
    // Log.d(TAG, "Make Screenshot: Failed.");
    // e.printStackTrace();
    //
    // return Uri();
    // }
    
    // return Uri.fromFile(file);
    return null;
    }
     

Share This Page