mirror of
https://github.com/nerzhul/ownCloud-SMS-App.git
synced 2026-08-24 06:43:07 +00:00
Add a loop which retrieve all messages without doing anything
This commit is contained in:
@@ -61,11 +61,11 @@ import static fr.unix_experience.owncloud_sms.enums.PermissionID.REQUEST_SMS;
|
||||
public class MainActivity extends AppCompatActivity
|
||||
implements NavigationView.OnNavigationItemSelectedListener{
|
||||
|
||||
private static ConnectivityMonitor mConnectivityMonitor = null;
|
||||
private ConnectivityMonitor _ConnectivityMonitor = null;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
if (MainActivity.mConnectivityMonitor == null) {
|
||||
MainActivity.mConnectivityMonitor = new ConnectivityMonitor(getApplicationContext());
|
||||
if (_ConnectivityMonitor == null) {
|
||||
_ConnectivityMonitor = new ConnectivityMonitor(getApplicationContext());
|
||||
}
|
||||
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
@@ -134,7 +134,7 @@ public class MainActivity extends AppCompatActivity
|
||||
}
|
||||
|
||||
Context ctx = getApplicationContext();
|
||||
if (MainActivity.mConnectivityMonitor.isValid()) {
|
||||
if (_ConnectivityMonitor.isValid()) {
|
||||
// Now fetch messages since last stored date
|
||||
JSONArray smsList = new JSONArray();
|
||||
new AndroidSmsFetcher(ctx).bufferMessagesSinceDate(smsList, (long) 0);
|
||||
|
||||
+20
@@ -1,5 +1,22 @@
|
||||
package fr.unix_experience.owncloud_sms.activities.remote_account;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2016, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import android.Manifest;
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
@@ -9,6 +26,7 @@ import android.support.v4.app.ActivityCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import fr.unix_experience.owncloud_sms.R;
|
||||
import fr.unix_experience.owncloud_sms.engine.ASyncSMSRecovery;
|
||||
|
||||
public class RestoreMessagesActivity extends AppCompatActivity {
|
||||
|
||||
@@ -45,6 +63,8 @@ public class RestoreMessagesActivity extends AppCompatActivity {
|
||||
if (_account == null) {
|
||||
throw new IllegalStateException(getString(R.string.err_didnt_find_account_restore));
|
||||
}
|
||||
|
||||
new ASyncSMSRecovery.SMSRecoveryTask(getApplicationContext(), _account).execute();
|
||||
}
|
||||
|
||||
private static final String TAG = RestoreMessagesActivity.class.getSimpleName();
|
||||
|
||||
Reference in New Issue
Block a user