Hola! This is my first post. I'm having trouble with the code snippet below.
Basically, you click an EditText and you're presented with a file browser. If you choose a file all is right with the world. If you choose the back/return button on your phone without choosing a file a force close is caused. I think this is because I'm returning a null from the intent, but I do not know how to fix nor what I should try/ catch. Your help is greatly appreciated. Code: filename = (EditText) findViewById(R.id.selectFile); filename.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("text/csv"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, "Select File"),1); } }); -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en