Fix some issues
This commit is contained in:
parent
bea8b9cc5e
commit
ddbd76bf15
|
@ -308,7 +308,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
||||||
//This task will allow to instance a static PeertubeInformation class
|
//This task will allow to instance a static PeertubeInformation class
|
||||||
if (social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE) {
|
if (social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE) {
|
||||||
try {
|
try {
|
||||||
new RetrievePeertubeInformationAsyncTask(getApplicationContext()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new RetrievePeertubeInformationAsyncTask(getApplicationContext()).execute();
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1272,7 +1272,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
||||||
int versionCode = BuildConfig.VERSION_CODE;
|
int versionCode = BuildConfig.VERSION_CODE;
|
||||||
if (lastReleaseNoteRead != versionCode) { //Need to push release notes
|
if (lastReleaseNoteRead != versionCode) { //Need to push release notes
|
||||||
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
|
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
|
||||||
new RetrieveRemoteDataAsyncTask(getApplicationContext(), BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new RetrieveRemoteDataAsyncTask(getApplicationContext(), BaseMainActivity.this).execute();
|
||||||
}
|
}
|
||||||
try (BufferedReader reader = new BufferedReader(
|
try (BufferedReader reader = new BufferedReader(
|
||||||
new InputStreamReader(getAssets().open("changelogs/" + versionCode + ".txt")))) {
|
new InputStreamReader(getAssets().open("changelogs/" + versionCode + ".txt")))) {
|
||||||
|
@ -1313,10 +1313,10 @@ public abstract class BaseMainActivity extends BaseActivity
|
||||||
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA || social == UpdateAccountInfoAsyncTask.SOCIAL.GNU || social == UpdateAccountInfoAsyncTask.SOCIAL.FRIENDICA) {
|
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA || social == UpdateAccountInfoAsyncTask.SOCIAL.GNU || social == UpdateAccountInfoAsyncTask.SOCIAL.FRIENDICA) {
|
||||||
|
|
||||||
// Retrieves instance
|
// Retrieves instance
|
||||||
new RetrieveInstanceAsyncTask(getApplicationContext(), BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new RetrieveInstanceAsyncTask(getApplicationContext(), BaseMainActivity.this).execute();
|
||||||
// Retrieves filters
|
// Retrieves filters
|
||||||
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
|
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
|
||||||
new ManageFiltersAsyncTask(getApplicationContext(), GET_ALL_FILTER, null, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new ManageFiltersAsyncTask(getApplicationContext(), GET_ALL_FILTER, null, BaseMainActivity.this).execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1327,7 +1327,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
||||||
new TimelineCacheDAO(BaseMainActivity.this, db).removeAfterDate(dateString);
|
new TimelineCacheDAO(BaseMainActivity.this, db).removeAfterDate(dateString);
|
||||||
});
|
});
|
||||||
if (Helper.isLoggedIn(getApplicationContext())) {
|
if (Helper.isLoggedIn(getApplicationContext())) {
|
||||||
new UpdateAccountInfoByIDAsyncTask(getApplicationContext(), social, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new UpdateAccountInfoByIDAsyncTask(getApplicationContext(), social, BaseMainActivity.this).execute();
|
||||||
}
|
}
|
||||||
mutedAccount = new TempMuteDAO(getApplicationContext(), db).getAllTimeMuted(account);
|
mutedAccount = new TempMuteDAO(getApplicationContext(), db).getAllTimeMuted(account);
|
||||||
|
|
||||||
|
@ -1469,7 +1469,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
||||||
if (!isUrl)
|
if (!isUrl)
|
||||||
return;
|
return;
|
||||||
//Here we know that the intent contains a valid URL
|
//Here we know that the intent contains a valid URL
|
||||||
new RetrieveRemoteDataAsyncTask(BaseMainActivity.this, url, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new RetrieveRemoteDataAsyncTask(BaseMainActivity.this, url, BaseMainActivity.this).execute();
|
||||||
}
|
}
|
||||||
} else if (Intent.ACTION_SEND.equals(action) && type != null) {
|
} else if (Intent.ACTION_SEND.equals(action) && type != null) {
|
||||||
if ("text/plain".equals(type)) {
|
if ("text/plain".equals(type)) {
|
||||||
|
@ -1633,9 +1633,6 @@ public abstract class BaseMainActivity extends BaseActivity
|
||||||
PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean("isMainActivityRunning", true).apply();
|
PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean("isMainActivityRunning", true).apply();
|
||||||
|
|
||||||
//Proceeds to update of the authenticated account
|
//Proceeds to update of the authenticated account
|
||||||
/*if (Helper.isLoggedIn(getApplicationContext())) {
|
|
||||||
new UpdateAccountInfoByIDAsyncTask(getApplicationContext(), social, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
|
||||||
}*/
|
|
||||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||||
String datestr = sharedpreferences.getString(Helper.HOME_LAST_READ + userId + instance, null);
|
String datestr = sharedpreferences.getString(Helper.HOME_LAST_READ + userId + instance, null);
|
||||||
|
|
||||||
|
@ -2051,7 +2048,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
||||||
if (accounts != null && accounts.size() > 0) {
|
if (accounts != null && accounts.size() > 0) {
|
||||||
developers = new ArrayList<>();
|
developers = new ArrayList<>();
|
||||||
developers.addAll(accounts);
|
developers.addAll(accounts);
|
||||||
new RetrieveRelationshipAsyncTask(getApplicationContext(), accounts.get(0).getId(), BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new RetrieveRelationshipAsyncTask(getApplicationContext(), accounts.get(0).getId(), BaseMainActivity.this).execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,8 +162,10 @@ public class SearchDAO {
|
||||||
*/
|
*/
|
||||||
private List<String> cursorToListSearch(Cursor c) {
|
private List<String> cursorToListSearch(Cursor c) {
|
||||||
//No element found
|
//No element found
|
||||||
if (c.getCount() == 0)
|
if (c.getCount() == 0) {
|
||||||
|
c.close();
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
List<String> searches = new ArrayList<>();
|
List<String> searches = new ArrayList<>();
|
||||||
while (c.moveToNext()) {
|
while (c.moveToNext()) {
|
||||||
if (c.getString(c.getColumnIndex(Sqlite.COL_NAME)) != null)
|
if (c.getString(c.getColumnIndex(Sqlite.COL_NAME)) != null)
|
||||||
|
@ -242,8 +244,10 @@ public class SearchDAO {
|
||||||
*/
|
*/
|
||||||
private List<TagTimeline> cursorToTagTimelineSearch(Cursor c) {
|
private List<TagTimeline> cursorToTagTimelineSearch(Cursor c) {
|
||||||
//No element found
|
//No element found
|
||||||
if (c.getCount() == 0)
|
if (c.getCount() == 0) {
|
||||||
|
c.close();
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
List<TagTimeline> searches = new ArrayList<>();
|
List<TagTimeline> searches = new ArrayList<>();
|
||||||
while (c.moveToNext()) {
|
while (c.moveToNext()) {
|
||||||
TagTimeline tagTimeline = new TagTimeline();
|
TagTimeline tagTimeline = new TagTimeline();
|
||||||
|
|
Loading…
Reference in New Issue