Hopefully solved app crash because of db lock

This commit is contained in:
David 2013-06-19 17:07:26 +02:00
parent dc2753ba9e
commit 82912e4cb7
6 changed files with 15 additions and 29 deletions

Binary file not shown.

Binary file not shown.

View file

@ -106,7 +106,7 @@
<!-- Login Dialog -->
<string name="login_dialog_title_error">Error</string>
<string name="login_dialog_text_something_went_wrong">Something went wrong :(</string>
<string name="login_dialog_text_not_compatible">This App version is not compatibel with you ownCloud News App. Please update the appframework!</string>
<string name="login_dialog_text_not_compatible">This App version is not compatibel with you ownCloud News App. Please update the news app and the appframework.</string>
<string name="login_dialog_title_security_warning">Security Warning</string>
<string name="login_dialog_text_security_warning">You\'re not using https. It\'s possible to get your password by Man in the Middle attacks. So it\'s strongly recommend to use https!</string>

View file

@ -23,7 +23,7 @@ import de.luhmer.owncloudnewsreader.R;
* Created by David on 24.05.13.
*/
public class ImageHandler {
private static final String TAG = "DownloadImagesFromWeb";
//private static final String TAG = "DownloadImagesFromWeb";
public static Drawable LoadImageFromWebOperations(String url) {
try {

View file

@ -1,15 +1,14 @@
package de.luhmer.owncloudnewsreader.reader;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.util.Log;
import de.luhmer.owncloudnewsreader.data.ConcreteSubscribtionItem;
import de.luhmer.owncloudnewsreader.data.FolderSubscribtionItem;
import de.luhmer.owncloudnewsreader.data.RssFile;
import de.luhmer.owncloudnewsreader.database.DatabaseConnection;
import java.util.ArrayList;
import java.util.List;
/**
* Created by David on 24.05.13.
*/
@ -24,7 +23,7 @@ public class InsertIntoDatabase {
//List<String[]> tags = (List<String[]>) task_result;
List<String> tagsAvailable = dbConn.convertCursorToStringArray(dbConn.getAllTopSubscriptions(true), 1);
dbConn.getDatabase().beginTransaction();
//dbConn.getDatabase().beginTransaction();
try
{
if(tags != null)
@ -61,9 +60,9 @@ public class InsertIntoDatabase {
Log.d("ADD", ""+ tagsToAdd.size());
Log.d("REMOVE", ""+ tagsToRemove.size());
}
dbConn.getDatabase().setTransactionSuccessful();
//dbConn.getDatabase().setTransactionSuccessful();
} finally {
dbConn.getDatabase().endTransaction();
//dbConn.getDatabase().endTransaction();
}
@ -76,7 +75,7 @@ public class InsertIntoDatabase {
List<String> tagsAvailable = dbConn.convertCursorToStringArray(dbConn.getAllSubSubscriptions(), 1);
dbConn.getDatabase().beginTransaction();
//dbConn.getDatabase().beginTransaction();
try
{
if(tags != null)
@ -114,9 +113,9 @@ public class InsertIntoDatabase {
//lvAdapter = new SubscriptionExpandableListAdapter(getActivity(), dbConn);
}
dbConn.getDatabase().setTransactionSuccessful();
//dbConn.getDatabase().setTransactionSuccessful();
} finally {
dbConn.getDatabase().endTransaction();
//dbConn.getDatabase().endTransaction();
}
dbConn.closeDatabase();
}
@ -126,7 +125,7 @@ public class InsertIntoDatabase {
{
DatabaseConnection dbConn = new DatabaseConnection(activity);
dbConn.getDatabase().beginTransaction();
//dbConn.getDatabase().beginTransaction();
try
{
if(files != null)
@ -134,9 +133,9 @@ public class InsertIntoDatabase {
for (RssFile rssFile : files)
InsertSingleFeedItemIntoDatabase(rssFile, dbConn);
}
dbConn.getDatabase().setTransactionSuccessful();
//dbConn.getDatabase().setTransactionSuccessful();
} finally {
dbConn.getDatabase().endTransaction();
//dbConn.getDatabase().endTransaction();
}
dbConn.closeDatabase();

View file

@ -1,25 +1,12 @@
package de.luhmer.owncloudnewsreader.reader.owncloud;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.preference.PreferenceManager;
import android.sax.StartElementListener;
import de.luhmer.owncloudnewsreader.Constants;
import de.luhmer.owncloudnewsreader.SettingsActivity;
import de.luhmer.owncloudnewsreader.data.RssFile;
import de.luhmer.owncloudnewsreader.database.DatabaseConnection;
import de.luhmer.owncloudnewsreader.reader.AsyncTask_Reader;
import de.luhmer.owncloudnewsreader.reader.FeedItemTags;
import de.luhmer.owncloudnewsreader.reader.FeedItemTags.TAGS;
import de.luhmer.owncloudnewsreader.reader.InsertIntoDatabase;
import de.luhmer.owncloudnewsreader.reader.OnAsyncTaskCompletedListener;
import de.luhmer.owncloudnewsreader.reader.GoogleReaderApi.GoogleReaderMethods;
import de.luhmer.owncloudnewsreader.services.DownloadImagesService;
public class AsyncTask_GetFeeds extends AsyncTask<Object, Void, Exception> implements AsyncTask_Reader {
@ -56,7 +43,7 @@ public class AsyncTask_GetFeeds extends AsyncTask<Object, Void, Exception> imple
@Override
protected Exception doInBackground(Object... params) {
FeedItemTags.TAGS tag = (TAGS) params[0];
//FeedItemTags.TAGS tag = (TAGS) params[0];
/*
String username = (String) params[0];
String password = (String) params[1];