Commit e100c387 authored by mistermad's avatar mistermad

* Clean projet:

- unnecessary classes remove
- unused resources remove
- permission "camera" and "get-account" remove
- unnecessary dependency remove (aikuma-cloud-storage-0.8.0.jar, nanohttpd-2.0.5.jar, commons-net-3.1.jar et 'com.google.android.gms:play-services:10.2.1')
parent a12f3a38
...@@ -24,14 +24,11 @@ android { ...@@ -24,14 +24,11 @@ android {
dependencies { dependencies {
compile files('libs/aikuma-cloud-storage-0.8.0.jar')
compile files('libs/commons-io-2.4.jar') compile files('libs/commons-io-2.4.jar')
compile files('libs/commons-lang3-3.1.jar') compile files('libs/commons-lang3-3.1.jar')
compile files('libs/commons-net-3.1.jar')
compile files('libs/guava-13.0.1.jar') compile files('libs/guava-13.0.1.jar')
compile files('libs/json-simple-1.1.1.jar') compile files('libs/json-simple-1.1.1.jar')
compile files('libs/musicg-1.4.2.0.jar') compile files('libs/musicg-1.4.2.0.jar')
compile files('libs/nanohttpd-2.0.5.jar')
compile files('libs/opencsv-2.3.jar') compile files('libs/opencsv-2.3.jar')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
...@@ -40,7 +37,6 @@ dependencies { ...@@ -40,7 +37,6 @@ dependencies {
compile project(path: ':library') compile project(path: ':library')
compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-core-utils:25.3.1' compile 'com.android.support:support-core-utils:25.3.1'
compile 'com.google.android.gms:play-services:10.2.1'
compile 'com.android.support:multidex:1.0.1' compile 'com.android.support:multidex:1.0.1'
compile 'javax.annotation:javax.annotation-api:1.2' compile 'javax.annotation:javax.annotation-api:1.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.android.support.constraint:constraint-layout:1.0.2'
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.getalp.ligaikuma.lig_aikuma.lig_aikuma" package="org.getalp.ligaikuma.lig_aikuma.lig_aikuma"
android:versionCode="3" android:versionCode="3"
android:versionName="3.0"> android:versionName="3.0">
<uses-sdk android:minSdkVersion="14"/> <uses-sdk android:minSdkVersion="14"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
...@@ -18,13 +15,10 @@ ...@@ -18,13 +15,10 @@
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-feature android:name="android.hardware.camera"/>
<application <application
android:name="android.support.multidex.MultiDexApplication" android:name="android.support.multidex.MultiDexApplication"
android:allowBackup="true" android:allowBackup="true"
...@@ -32,179 +26,21 @@ ...@@ -32,179 +26,21 @@
android:label="@string/app_name" android:label="@string/app_name"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/MyTheme"> android:theme="@style/MyTheme">
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
<receiver android:name="org.getalp.ligaikuma.lig_aikuma.service.BootReceiver">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
</intent-filter>
</receiver>
<activity <activity
android:name="org.getalp.ligaikuma.lig_aikuma.MainActivity" android:name="org.getalp.ligaikuma.lig_aikuma.MainActivity"
android:label="@string/app_name" android:label="@string/app_name"
android:windowSoftInputMode="adjustPan"> android:windowSoftInputMode="adjustPan">
</activity> </activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.ListenActivity"
android:configChanges="orientation"
android:label="@string/app_name"
tools:targetApi="jelly_bean">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.ListenRespeakingActivity"
android:configChanges="orientation"
android:label="@string/app_name"
tools:targetApi="jelly_bean">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.CloudSearchActivity"
android:configChanges="orientation"
android:label="@string/app_name"
tools:targetApi="jelly_bean">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordActivity"
android:configChanges="orientation"
android:label="@string/app_name"
tools:targetApi="jelly_bean">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordVideoActivity"
android:configChanges="orientation"
android:label="@string/app_name"
tools:targetApi="jelly_bean">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.SettingsActivity"
android:configChanges="orientation"
android:label="@string/app_name"
tools:targetApi="jelly_bean">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordingMetadataActivity1"
android:configChanges="orientation"
android:label="@string/app_name"
tools:targetApi="jelly_bean">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordingMetadataActivity2"
android:configChanges="orientation"
android:label="@string/app_name"
tools:targetApi="jelly_bean">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordingMetadataActivity3"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordingMetadataActivity4"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.LanguageFilterList"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordingSpeakersActivity"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.MainSpeakersActivity"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.AddSpeakerActivity1"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.AddSpeakerActivity2"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.AddSpeakerActivity3"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.AddSpeakerActivity4"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity <activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.ThumbRespeakActivity" android:name="org.getalp.ligaikuma.lig_aikuma.ui.ThumbRespeakActivity"
android:configChanges="orientation" android:configChanges="orientation"
android:label="@string/app_name"> android:label="@string/app_name">
</activity> </activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.PhoneRespeakActivity"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.AddCustomLanguageActivity"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.DefaultLanguagesActivity"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.CloudSettingsActivity"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.SyncSettingsActivity"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.AboutActivity"
android:configChanges="orientation"
android:label="@string/app_name">
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.HttpServerActivity"
android:label="@string/http_server_activity_title">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.getalp.ligaikuma.lig_aikuma.MainActivity"/>
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.HowtoActivity"
android:label="@string/http_server_activity_title"
android:parentActivityName="org.getalp.ligaikuma.lig_aikuma.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.getalp.ligaikuma.lig_aikuma.MainActivity"/>
</activity>
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.DebugInfo"
android:label="@string/title_activity_debug_info"
android:parentActivityName="org.getalp.ligaikuma.lig_aikuma.ui.AboutActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.getalp.ligaikuma.lig_aikuma.ui.AboutActivity"/>
</activity>
<service android:name="org.getalp.ligaikuma.lig_aikuma.service.GoogleCloudService"/>
<activity android:name="org.getalp.ligaikuma.lig_aikuma.ModeSelection"> <activity android:name="org.getalp.ligaikuma.lig_aikuma.ModeSelection">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
...@@ -212,7 +48,7 @@ ...@@ -212,7 +48,7 @@
android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordingMetadataLig" android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordingMetadataLig"
android:configChanges="orientation|screenSize"> android:configChanges="orientation|screenSize">
</activity> </activity>
<activity android:name="org.getalp.ligaikuma.lig_aikuma.ui.LanguageFilterListLIG"/> <activity android:name="org.getalp.ligaikuma.lig_aikuma.ui.LanguageFilterList"/>
<activity <activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordActivityLig" android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordActivityLig"
android:configChanges="orientation|screenSize"/> android:configChanges="orientation|screenSize"/>
...@@ -230,15 +66,9 @@ ...@@ -230,15 +66,9 @@
<activity <activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.ElicitationMode" android:name="org.getalp.ligaikuma.lig_aikuma.ui.ElicitationMode"
android:configChanges="orientation|screenSize"/> android:configChanges="orientation|screenSize"/>
<activity android:name="org.getalp.ligaikuma.lig_aikuma.ui.TranslationSelection"/>
<activity <activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordElicitation" android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordElicitation"
android:configChanges="orientation|screenSize"/> android:configChanges="orientation|screenSize"/>
<!--
<activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.RecordElicitationImage"
android:configChanges="orientation|screenSize" /> Not found in project
-->
<activity <activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.CheckMode" android:name="org.getalp.ligaikuma.lig_aikuma.ui.CheckMode"
android:configChanges="orientation|screenSize"/> android:configChanges="orientation|screenSize"/>
...@@ -248,12 +78,9 @@ ...@@ -248,12 +78,9 @@
<activity <activity
android:name="org.getalp.ligaikuma.lig_aikuma.ui.CheckTranscription" android:name="org.getalp.ligaikuma.lig_aikuma.ui.CheckTranscription"
android:configChanges="orientation|screenSize"/> android:configChanges="orientation|screenSize"/>
<activity android:name="org.getalp.ligaikuma.lig_aikuma.ui.SpeakerActivity"> <activity android:name="org.getalp.ligaikuma.lig_aikuma.ui.SpeakerActivity"/>
</activity> <activity android:name="org.getalp.ligaikuma.lig_aikuma.ui.ShareFileActivity"/>
<activity android:name="org.getalp.ligaikuma.lig_aikuma.ui.ShareFileActivity"> <activity android:name="org.getalp.ligaikuma.lig_aikuma.ui.ElicitationFileSearch"/>
</activity>
<activity android:name="org.getalp.ligaikuma.lig_aikuma.ui.ElicitationFileSearch">
</activity>
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -4,70 +4,29 @@ ...@@ -4,70 +4,29 @@
*/ */
package org.getalp.ligaikuma.lig_aikuma; package org.getalp.ligaikuma.lig_aikuma;
import android.accounts.AccountManager;
import android.annotation.SuppressLint;
import android.app.ActionBar; import android.app.ActionBar;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.ListActivity; import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment;
import android.os.Parcelable; import android.os.Parcelable;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log; import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.ListView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.google.android.gms.auth.GoogleAuthException;
import com.google.android.gms.auth.GoogleAuthUtil;
import com.google.android.gms.auth.GooglePlayServicesAvailabilityException;
import com.google.android.gms.auth.UserRecoverableAuthException;
import com.google.android.gms.common.AccountPicker;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.musicg.wave.Wave;
import org.apache.commons.io.FileUtils;
import org.getalp.ligaikuma.lig_aikuma.lig_aikuma.BuildConfig; import org.getalp.ligaikuma.lig_aikuma.lig_aikuma.BuildConfig;
import org.getalp.ligaikuma.lig_aikuma.lig_aikuma.R; import org.getalp.ligaikuma.lig_aikuma.lig_aikuma.R;
import org.getalp.ligaikuma.lig_aikuma.model.Recording; import org.getalp.ligaikuma.lig_aikuma.model.Recording;
import org.getalp.ligaikuma.lig_aikuma.service.GoogleCloudService;
import org.getalp.ligaikuma.lig_aikuma.ui.ListenActivity;
import org.getalp.ligaikuma.lig_aikuma.ui.MenuBehaviour;
import org.getalp.ligaikuma.lig_aikuma.ui.RecordingArrayAdapter;
import org.getalp.ligaikuma.lig_aikuma.ui.RecordingMetadataActivity1;
import org.getalp.ligaikuma.lig_aikuma.ui.sensors.LocationDetector; import org.getalp.ligaikuma.lig_aikuma.ui.sensors.LocationDetector;
import org.getalp.ligaikuma.lig_aikuma.util.AikumaSettings; import org.getalp.ligaikuma.lig_aikuma.util.AikumaSettings;
import org.getalp.ligaikuma.lig_aikuma.util.SyncUtil;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FilenameFilter;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.UUID;
// For audio imports
/** /**
* The primary activity that lists existing recordings and allows you to select * The primary activity that lists existing recordings and allows you to select
...@@ -78,6 +37,13 @@ import java.util.UUID; ...@@ -78,6 +37,13 @@ import java.util.UUID;
*/ */
public class MainActivity extends ListActivity { public class MainActivity extends ListActivity {
private static final String TAG = "MainActivity";
private static final int RECOVER_FROM_AUTH_ERROR_REQUEST_CODE = 1001;
private static final int RECOVER_FROM_GOOGLEPLAY_ERROR_REQUEST_CODE = 1002;
public static LocationDetector locationDetector;
// Helps us store how far down the list we are when MainActivity gets // Helps us store how far down the list we are when MainActivity gets
// stopped. // stopped.
private Parcelable listViewState; private Parcelable listViewState;
...@@ -87,8 +53,6 @@ public class MainActivity extends ListActivity { ...@@ -87,8 +53,6 @@ public class MainActivity extends ListActivity {
{ {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.main); setContentView(R.layout.main);
menuBehaviour = new MenuBehaviour(this);
SyncUtil.startSyncLoop(this);
//new Aikuma(); //new Aikuma();
//Aikuma.loadLanguages(this.getApplicationContext()); //Aikuma.loadLanguages(this.getApplicationContext());
...@@ -101,55 +65,12 @@ public class MainActivity extends ListActivity { ...@@ -101,55 +65,12 @@ public class MainActivity extends ListActivity {
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this); SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
// settings.edit().clear().commit(); // settings.edit().clear().commit();
emailAccount = settings.getString(AikumaSettings.SETTING_OWNER_ID_KEY, null);
googleAuthToken = settings.getString(AikumaSettings.SETTING_AUTH_TOKEN_KEY, null);
googleIdToken = settings.getString(AikumaSettings.SETTING_ID_TOKEN_KEY, null);
googleAPIScope = AikumaSettings.getScope();
if(BuildConfig.DEBUG)Log.i(TAG, "Account: " + emailAccount + ", scope: " + googleAPIScope);
AikumaSettings.setUserId(emailAccount);
showUserAccount(emailAccount, null);
AikumaSettings.isBackupEnabled = settings.getBoolean(AikumaSettings.BACKUP_MODE_KEY, false); AikumaSettings.isBackupEnabled = settings.getBoolean(AikumaSettings.BACKUP_MODE_KEY, false);
AikumaSettings.isAutoDownloadEnabled = settings.getBoolean(AikumaSettings.AUTO_DOWNLOAD_MODE_KEY, false); AikumaSettings.isAutoDownloadEnabled = settings.getBoolean(AikumaSettings.AUTO_DOWNLOAD_MODE_KEY, false);
// Automatic validation
if(emailAccount != null) {
// Validate access token
// (And if there are items to be archived, upload them)
if (Aikuma.isDeviceOnline())
new GetTokenTask(emailAccount, googleAPIScope, settings, false).execute();
else
Toast.makeText(this, "Network is disconnected", Toast.LENGTH_SHORT).show();
} else if(AikumaSettings.isBackupEnabled || AikumaSettings.isAutoDownloadEnabled)
// When backup was enabled but the user hasn't ever signed-in google account
getAccountToken();
// Start gathering location data // Start gathering location data
MainActivity.locationDetector = new LocationDetector(this); MainActivity.locationDetector = new LocationDetector(this);
// Create a broadcastReceiver to receive sync-data
syncReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String status = intent.getStringExtra(GoogleCloudService.SYNC_STATUS);
if(status.equals("start"))
showProgressStatus(View.VISIBLE);
else if(status.equals("end"))
showProgressStatus(View.GONE);
else if(status.endsWith("source")) { //source-download
String[] splitName = status.split("-");
try {
updateRecordingView(Recording.read(splitName[0], splitName[2], status.substring(4)));
} catch (IOException e) {
if(BuildConfig.DEBUG)Log.e(TAG, e.getMessage());
}
}
}
};
checkDate(); checkDate();
// Create an index file when app starts // Create an index file when app starts
try { try {
...@@ -157,24 +78,6 @@ public class MainActivity extends ListActivity { ...@@ -157,24 +78,6 @@ public class MainActivity extends ListActivity {
} catch (IOException e) { } catch (IOException e) {
if(BuildConfig.DEBUG)Log.e(TAG, e.getMessage()); if(BuildConfig.DEBUG)Log.e(TAG, e.getMessage());
} }
//TODO: Update existing files
/*
String appVersionName = settings.getString(AikumaSettings.SETTING_VERSION_KEY, "");
if(!appVersionName.equals(AikumaSettings.getLatestVersion())) {
// Update the file structure and metadata
new UpdateUtils(this).update();
} */
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
return menuBehaviour.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
return menuBehaviour.onOptionsItemSelected(item);
} }
@Override @Override
...@@ -190,17 +93,7 @@ public class MainActivity extends ListActivity { ...@@ -190,17 +93,7 @@ public class MainActivity extends ListActivity {
List<Recording> recordings = Recording.readAll(); List<Recording> recordings = Recording.readAll();
if(BuildConfig.DEBUG)Log.i(TAG, "num: " +recordings.size()); if(BuildConfig.DEBUG)Log.i(TAG, "num: " +recordings.size());
// Filter the recordings for originals
originals = new ArrayList<>();
for(Recording recording : recordings)
if(recording.isOriginal())
originals.add(recording);
if(BuildConfig.DEBUG)Log.i(TAG, "original num: " + originals.size());
adapter = new RecordingArrayAdapter(this, originals);
setListAdapter(adapter);
if(listViewState != null) if(listViewState != null)
getListView