Author: tian
Date: Sat Mar  5 22:44:04 2016
New Revision: 2271

URL: http://svn.gna.org/viewcvs/gcstar?rev=2271&view=rev
Log:
Fixed crash when loading multiple files

Modified:
    viewer/AndroidManifest.xml
    viewer/src/com/gcstar/viewer/GCstarCollectionLoader.java
    viewer/src/com/gcstar/viewer/GCstarViewer.java

Modified: viewer/AndroidManifest.xml
URL: 
http://svn.gna.org/viewcvs/gcstar/viewer/AndroidManifest.xml?rev=2271&r1=2270&r2=2271&view=diff
==============================================================================
--- viewer/AndroidManifest.xml  (original)
+++ viewer/AndroidManifest.xml  Sat Mar  5 22:44:04 2016
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android";
       package="com.gcstar.viewer"
-      android:versionCode="12"
-      android:versionName="2.10">
+      android:versionCode="13"
+      android:versionName="2.11">
     <application android:icon="@drawable/icon" 
android:label="@string/app_name">
-        <activity android:name=".GCstarViewer"
+        <activity android:name="com.gcstar.viewer.GCstarViewer"
                   android:label="@string/app_name"
                   android:configChanges="keyboardHidden|orientation"
                   android:launchMode="singleTop">

Modified: viewer/src/com/gcstar/viewer/GCstarCollectionLoader.java
URL: 
http://svn.gna.org/viewcvs/gcstar/viewer/src/com/gcstar/viewer/GCstarCollectionLoader.java?rev=2271&r1=2270&r2=2271&view=diff
==============================================================================
--- viewer/src/com/gcstar/viewer/GCstarCollectionLoader.java    (original)
+++ viewer/src/com/gcstar/viewer/GCstarCollectionLoader.java    Sat Mar  5 
22:44:04 2016
@@ -135,7 +135,10 @@
     {
         protected Integer doInBackground(GCstarCollectionLoader... p)
         {
-               Looper.prepare();       // Alessio Del Trecco (Morg4n): fix 
crash on loading
+            if (Looper.myLooper() == null)
+            {
+                Looper.prepare();    // Alessio Del Trecco (Morg4n): fix crash 
on loading
+            }
             _parent = p[0];
             _parent.loadFile(_parent._fileName);
             return 0;

Modified: viewer/src/com/gcstar/viewer/GCstarViewer.java
URL: 
http://svn.gna.org/viewcvs/gcstar/viewer/src/com/gcstar/viewer/GCstarViewer.java?rev=2271&r1=2270&r2=2271&view=diff
==============================================================================
--- viewer/src/com/gcstar/viewer/GCstarViewer.java      (original)
+++ viewer/src/com/gcstar/viewer/GCstarViewer.java      Sat Mar  5 22:44:04 2016
@@ -22,19 +22,15 @@
 
 package com.gcstar.viewer;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.regex.Pattern;
-
 import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.Dialog;
 import android.app.SearchManager;
 import android.content.Context;
 import android.content.DialogInterface;
+import android.content.DialogInterface.OnClickListener;
 import android.content.Intent;
 import android.content.SharedPreferences;
-import android.content.DialogInterface.OnClickListener;
 import android.content.res.Configuration;
 import android.graphics.BitmapFactory;
 import android.os.AsyncTask;
@@ -47,6 +43,7 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
 import android.widget.ArrayAdapter;
 import android.widget.BaseAdapter;
 import android.widget.EditText;
@@ -54,7 +51,13 @@
 import android.widget.ImageView;
 import android.widget.ListView;
 import android.widget.Toast;
-import android.widget.AdapterView.OnItemClickListener;
+
+//import com.gcstar.viewer.GCstarSuggestions;
+import com.gcstar.viewer.GCstarModel;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.regex.Pattern;
 
 public class GCstarViewer extends Activity implements OnClickListener,
         OnItemClickListener
@@ -158,7 +161,10 @@
     {
         setIntent(intent);
         String query = intent.getStringExtra(SearchManager.QUERY);
-        filterItems(query);
+        if (query != null)
+        {
+            filterItems(query);
+        }
     }
 
     @Override
@@ -381,8 +387,8 @@
             _parent = p[0];
             ArrayList<String> wordList = new ArrayList<String>();
             SearchRecentSuggestions suggestions = new SearchRecentSuggestions(
-                    _parent, GCstarSuggestions.AUTHORITY,
-                    GCstarSuggestions.MODE);
+                    _parent, com.gcstar.viewer.GCstarSuggestions.AUTHORITY,
+                    com.gcstar.viewer.GCstarSuggestions.MODE);
             suggestions.clearHistory();
             Pattern pattern = Pattern.compile("\\W");
 
@@ -459,7 +465,7 @@
         }
     }
 
-    public void setModel(GCstarModel model)
+    public void setModel(com.gcstar.viewer.GCstarModel model)
     {
         _dialog.setModel(model);
     }


_______________________________________________
GCstar-commits mailing list
[email protected]
https://mail.gna.org/listinfo/gcstar-commits

Reply via email to