diff --git a/wpadebug/src/w1/fi/wpadebug/CommandListActivity.java b/wpadebug/src/w1/fi/wpadebug/CommandListActivity.java index fb4268ecf..6d7ad4dd6 100644 --- a/wpadebug/src/w1/fi/wpadebug/CommandListActivity.java +++ b/wpadebug/src/w1/fi/wpadebug/CommandListActivity.java @@ -77,8 +77,14 @@ public class CommandListActivity extends ListActivity Toast.LENGTH_SHORT).show(); } - InputStream inres = getResources().openRawResource(R.raw.shell_commands); - read_commands(list, new Scanner(inres)); + InputStream inres; + try { + inres = getResources().openRawResource(R.raw.shell_commands); + read_commands(list, new Scanner(inres)); + } catch (android.content.res.Resources.NotFoundException e) { + Toast.makeText(this, "Could not read internal resource", + Toast.LENGTH_SHORT).show(); + } ArrayAdapter listAdapter; listAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, list); diff --git a/wpadebug/src/w1/fi/wpadebug/WpaCommandListActivity.java b/wpadebug/src/w1/fi/wpadebug/WpaCommandListActivity.java index 4ad9b2d1b..e08917934 100644 --- a/wpadebug/src/w1/fi/wpadebug/WpaCommandListActivity.java +++ b/wpadebug/src/w1/fi/wpadebug/WpaCommandListActivity.java @@ -59,8 +59,14 @@ public class WpaCommandListActivity extends ListActivity Toast.LENGTH_SHORT).show(); } - InputStream inres = getResources().openRawResource(R.raw.wpa_commands); - read_commands(list, new Scanner(inres)); + InputStream inres; + try { + inres = getResources().openRawResource(R.raw.wpa_commands); + read_commands(list, new Scanner(inres)); + } catch (android.content.res.Resources.NotFoundException e) { + Toast.makeText(this, "Could not read internal resource", + Toast.LENGTH_SHORT).show(); + } ArrayAdapter listAdapter; listAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, list);