private synchronized void startRenderThread(final int page, final float zoom) { if (backgroundThread != null) return; mGraphView.showText("reading page " + page + ", zoom:" + zoom); backgroundThread = new Thread( new Runnable() { @Override public void run() { try { if (mPdfFile != null) { // File f = new File("/sdcard/andpdf.trace"); // f.delete(); // Log.e(TAG, "DEBUG.START"); // Debug.startMethodTracing("andpdf"); showPage(page, zoom); // Debug.stopMethodTracing(); // Log.e(TAG, "DEBUG.STOP"); } } catch (Exception e) { Log.e(TAG, e.getMessage(), e); } backgroundThread = null; } }); updateImageStatus(); backgroundThread.start(); }