fixed null pointer

This commit is contained in:
Pavol Zibrita 2011-06-28 10:13:48 +02:00
parent 5656c296af
commit 8349d3d248

View file

@ -48,6 +48,7 @@ import android.app.AlertDialog.Builder;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.Editable;
@ -119,10 +120,13 @@ public class DownloadIndexActivity extends ListActivity {
filterText = (EditText) findViewById(R.id.search_box);
filterText.addTextChangedListener(textWatcher);
final String filter = getIntent().getExtras().getString(FILTER_KEY);
final Intent intent = getIntent();
if (intent != null && intent.getExtras() != null) {
final String filter = intent.getExtras().getString(FILTER_KEY);
if (filter != null) {
filterText.setText(filter);
}
}
if(downloadListIndexThread.getCachedIndexFiles() != null){
setListAdapter(new DownloadIndexAdapter(downloadListIndexThread.getCachedIndexFiles()));