Fix for double-click NPE?

This commit is contained in:
Moxie Marlinspike 2013-05-06 19:27:09 -07:00
parent 7090ca4a42
commit 6fedc6b737

View File

@ -37,7 +37,6 @@ import org.thoughtcrime.securesms.util.MemoryCleaner;
public class PassphrasePromptActivity extends PassphraseActivity { public class PassphrasePromptActivity extends PassphraseActivity {
private EditText passphraseText; private EditText passphraseText;
private Button okButton;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -48,8 +47,8 @@ public class PassphrasePromptActivity extends PassphraseActivity {
} }
private void initializeResources() { private void initializeResources() {
passphraseText = (EditText)findViewById(R.id.passphrase_edit); Button okButton = (Button) findViewById(R.id.ok_button);
okButton = (Button)findViewById(R.id.ok_button); passphraseText = (EditText)findViewById(R.id.passphrase_edit);
okButton.setOnClickListener(new OkButtonClickListener()); okButton.setOnClickListener(new OkButtonClickListener());
} }
@ -75,7 +74,7 @@ public class PassphrasePromptActivity extends PassphraseActivity {
@Override @Override
protected void cleanup() { protected void cleanup() {
this.passphraseText = null; this.passphraseText.setText("");
System.gc(); System.gc();
} }
} }