Skip to content

Commit 28e8ecc

Browse files
committed
sort add from background thread, then notify the adapter when finished.
1 parent 7425363 commit 28e8ecc

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

cSploit/src/org/csploit/android/MainActivity.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
import org.csploit.android.gui.dialogs.MultipleChoiceDialog;
6969
import org.csploit.android.gui.dialogs.SpinnerDialog;
7070
import org.csploit.android.gui.dialogs.SpinnerDialog.SpinnerDialogListener;
71+
import org.csploit.android.helpers.ThreadHelper;
7172
import org.csploit.android.net.Network;
7273
import org.csploit.android.net.Target;
7374
import org.csploit.android.plugins.ExploitFinder;
@@ -607,15 +608,11 @@ public boolean onOptionsItemSelected(final MenuItem item) {
607608
public void onInputEntered(String input) {
608609
final Target target = Target.getFromString(input);
609610
if (target != null) {
610-
// refresh the target listview
611-
MainActivity.this.runOnUiThread(new Runnable() {
611+
ThreadHelper.getSharedExecutor().execute(new Runnable() {
612612
@Override
613613
public void run() {
614-
if (System.addOrderedTarget(target)
615-
&& mTargetAdapter != null) {
616-
mTargetAdapter
617-
.notifyDataSetChanged();
618-
}
614+
System.addOrderedTarget(target);
615+
mTargetAdapter.update(null, null);
619616
}
620617
});
621618
} else

0 commit comments

Comments
 (0)