From 06b389e413e69514b4e6122c04500ff3258f3a17 Mon Sep 17 00:00:00 2001 From: Tim Su Date: Thu, 15 Jul 2010 16:52:56 -0700 Subject: [PATCH] fixed npe --- .../todoroo/astrid/activity/TaskListActivity.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java index 0a094af4a..77d9e654f 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java @@ -19,26 +19,26 @@ import android.content.pm.ResolveInfo; import android.database.Cursor; import android.os.Bundle; import android.view.ContextMenu; +import android.view.ContextMenu.ContextMenuInfo; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.view.Window; -import android.view.ContextMenu.ContextMenuInfo; import android.view.View.OnClickListener; import android.view.View.OnKeyListener; +import android.view.Window; import android.view.inputmethod.EditorInfo; import android.widget.AbsListView; +import android.widget.AbsListView.OnScrollListener; +import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.EditText; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.ListView; import android.widget.RemoteViews; import android.widget.TextView; -import android.widget.Toast; -import android.widget.AbsListView.OnScrollListener; -import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.TextView.OnEditorActionListener; +import android.widget.Toast; import com.flurry.android.FlurryAgent; import com.timsu.astrid.R; @@ -265,7 +265,8 @@ public class TaskListActivity extends ListActivity implements OnScrollListener { quickAddBox.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { - quickAddButton.setVisibility(View.VISIBLE); + if(event != null && event.isPrintingKey()) + quickAddButton.setVisibility(View.VISIBLE); return false; } });