Note that there are some explanatory texts on larger screens.

plurals
  1. POleaked window again
    primarykey
    data
    text
    <pre><code>06-25 15:03:02.596: E/WindowManager(29217): at com.android.grad.PreviewActivity$1.onClick(PreviewActivity.java:36) 06-25 15:03:02.596: E/WindowManager(29217): at android.view.View.performClick(View.java:3527) 06-25 15:03:02.596: E/WindowManager(29217): at android.view.View$PerformClick.run(View.java:14234) 06-25 15:03:02.596: E/WindowManager(29217): at android.os.Handler.handleCallback(Handler.java:605) 06-25 15:03:02.596: E/WindowManager(29217): at android.os.Handler.dispatchMessage(Handler.java:92) 06-25 15:03:02.596: E/WindowManager(29217): at android.os.Looper.loop(Looper.java:137) 06-25 15:03:02.596: E/WindowManager(29217): at android.app.ActivityThread.main(ActivityThread.java:4441) 06-25 15:03:02.596: E/WindowManager(29217): at java.lang.reflect.Method.invokeNative(Native Method) 06-25 15:03:02.596: E/WindowManager(29217): at java.lang.reflect.Method.invoke(Method.java:511) 06-25 15:03:02.596: E/WindowManager(29217): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 06-25 15:03:02.596: E/WindowManager(29217): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 06-25 15:03:02.596: E/WindowManager(29217): at dalvik.system.NativeStart.main(Native Method) 06-25 15:03:04.186: I/Process(29217): Sending signal. PID: 29217 SIG: 9 06-25 15:03:04.566: D/TextLayoutCache(29339): Using debug level: 0 - Debug Enabled: 0 06-25 15:03:04.606: D/libEGL(29339): loaded /system/lib/egl/libGLES_android.so 06-25 15:03:04.606: D/libEGL(29339): loaded /system/lib/egl/libEGL_adreno200.so 06-25 15:03:04.636: D/libEGL(29339): loaded /system/lib/egl/libGLESv1_CM_adreno200.so 06-25 15:03:04.636: D/dalvikvm(29339): GC_CONCURRENT freed 117K, 3% free 9125K/9351K, paused 4ms+17ms 06-25 15:03:04.636: D/libEGL(29339): loaded /system/lib/egl/libGLESv2_adreno200.so 06-25 15:03:04.706: D/OpenGLRenderer(29339): Enabling debug mode 0 06-25 15:03:07.326: D/OpenGLRenderer(29339): Flushing caches (mode 0) 06-25 15:03:07.326: W/IInputConnectionWrapper(29339): showStatusIcon on inactive InputConnection 06-25 15:03:07.366: D/OpenGLRenderer(29339): Flushing caches (mode 1) </code></pre> <p>I know that this error asked before and i saw the solutions for that but the solutions don't work with me. and this is my code.</p> <p>The error appear on pd.show().</p> <pre><code>@Override protected void onPreExecute() { //network.loadData(); file = new File( Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "MyCameraApp" + File.separator + "project"); createProgressDialog(); pd.show(); } @Override protected Boolean doInBackground(String... params) { try { crop = new Crop(params[0]); crop.cropID(); croppedID = crop.getId(); publishProgress(2); } catch (IOException e) { } segmentNumbers(); return true; } @Override protected void onProgressUpdate(Integer... values) { pd.incrementProgressBy(values[0]); } @Override protected void onPostExecute(Boolean result) { pd.dismiss(); Toast.makeText(activity, "Processing Done", Toast.LENGTH_LONG).show(); } private void createProgressDialog() { pd = new ProgressDialog(activity); pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); pd.setTitle("Extract ID"); pd.setMessage("Processing..."); pd.setIcon(R.drawable.ic_launcher); pd.setProgress(0); pd.setCancelable(false); } </code></pre> <p>onpreExecution method :- i am showing my dialog. doInBackGround method :- I execute my segmentNumber() which used to segement picture. onPostExecution method :- I am dismissing my dialog.</p> <p>Modified code :</p> <pre><code>package com.OCR.ID; import java.io.File; import java.io.IOException; import org.neuroph.contrib.imgrec.image.Image; import org.neuroph.contrib.imgrec.image.ImageFactory; import android.app.Activity; import android.app.ProgressDialog; import android.os.AsyncTask; import android.os.Environment; import android.util.Log; import android.widget.Toast; import com.Camera.R; /** * @author Mahmud * */ public class Segement extends AsyncTask&lt;String, Integer, Boolean&gt; { int[][] croppedID; Crop crop; private Activity activity; private ProgressDialog pd; File file; private String ID; private Neuroph network; public Segement(Activity activity, ProgressDialog pd) throws IOException { this.activity = activity; this.pd = pd; //network = new Neuroph(this.activity); } @Override protected void onPreExecute() { //network.loadData(); file = new File( Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "MyCameraApp" + File.separator + "project"); } @Override protected Boolean doInBackground(String... params) { try { crop = new Crop(params[0]); crop.cropID(); croppedID = crop.getId(); publishProgress(2); } catch (IOException e) { } segmentNumbers(); return true; } @Override protected void onProgressUpdate(Integer... values) { pd.incrementProgressBy(values[0]); } @Override protected void onPostExecute(Boolean result) { pd.dismiss(); Toast.makeText(activity, "Processing Done &amp; your ID : " + ID, Toast.LENGTH_LONG + Toast.LENGTH_LONG).show(); } /** * Segment cropped image into number */ public void segmentNumbers() { int count = 0, endOfNumber = 0, startOfNumber = 0; int[][] number = null; while (crop.getxProjection()[endOfNumber] == 0 &amp;&amp; endOfNumber != crop.getxProjection().length - 1) endOfNumber++; while (endOfNumber != croppedID.length - 1) { endOfNumber = startOfNumber; while (crop.getxProjection()[endOfNumber] != 0 &amp;&amp; endOfNumber != crop.getxProjection().length - 1) endOfNumber++; if (endOfNumber - startOfNumber &lt; 10) { startOfNumber = endOfNumber; while (crop.getxProjection()[startOfNumber] == 0 &amp;&amp; endOfNumber != crop.getxProjection().length - 1) startOfNumber++; continue; } if (startOfNumber &gt;= croppedID.length || endOfNumber &gt;= croppedID.length) break; number = new int[endOfNumber - startOfNumber - 1][croppedID[0].length]; for (int i = 0; i &lt; number.length; i++) for (int j = 0; j &lt; number[i].length; j++) number[i][j] = croppedID[i + startOfNumber][j]; number = verticalProjectionForNumber(number); File numberFile = AndroidImage.save(activity, AndroidImage.write2DIntoImage(number), Integer.toString(count)); // Image image = ImageFactory.getImage(numberFile.getAbsoluteFile()); // ID += network.recognize(image); // // file.getPath() + File.separator + Integer.toString(count) + // ".PNG"); publishProgress(7); startOfNumber = endOfNumber; while (crop.getxProjection()[startOfNumber] == 0 &amp;&amp; endOfNumber != crop.getxProjection().length - 1) startOfNumber++; count++; } Log.d("ID", ID); } /** * Do vertical projection on each number */ private int[][] verticalProjectionForNumber(int[][] number) { int[] projection = new int[number[0].length]; for (int i = 0; i &lt; (number[0].length * 0.90); i++) { for (int j = 0; j &lt; number.length; j++) { projection[i] += number[j][i]; } } int first = 0; while (projection[first] == 0) first++; int last = projection.length - 1; while (projection[last] == 0) last--; int[][] modifiedNumber = new int[number.length][last - first]; for (int i = 0; i &lt; modifiedNumber.length; i++) for (int j = 0; j &lt; modifiedNumber[i].length; j++) modifiedNumber[i][j] = number[i][j + first]; number = null; projection = null; System.gc(); return modifiedNumber; } } </code></pre> <p>And i called the task from here :-</p> <pre><code>OnClickListener processOnClickListener = new OnClickListener() { public void onClick(View v) { try { createProgressDialog(); pd.show(); new Segement(PreviewActivity.this, pd).execute(path); } catch (IOException e) { } } }; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload