# HG changeset patch
# User Brad Greco
# Date 1338431587 18000
# Node ID a684ded7d9205dbda79be510f1cd0604df94466a
# Parent adceb82e0818b5c9093b5f2bdadf1d21da1ed8d3
Prevent crash when not passed a bundle. Thanks to Curtis Tuplin for the fix.
diff -r adceb82e0818 -r a684ded7d920 .classpath
--- a/.classpath Sat Jun 04 22:20:54 2011 -0400
+++ b/.classpath Wed May 30 21:33:07 2012 -0500
@@ -3,5 +3,6 @@
-
+
+
diff -r adceb82e0818 -r a684ded7d920 AndroidManifest.xml
--- a/AndroidManifest.xml Sat Jun 04 22:20:54 2011 -0400
+++ b/AndroidManifest.xml Wed May 30 21:33:07 2012 -0500
@@ -1,8 +1,8 @@
+ android:versionCode="2"
+ android:versionName="1.0.1">
@@ -20,22 +38,6 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
-
-import android.app.ListActivity;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Bundle;
-import android.os.Environment;
-import android.view.View;
-import android.widget.AdapterView;
-import android.widget.AdapterView.OnItemClickListener;
-import android.widget.ArrayAdapter;
-import android.widget.Button;
-import android.widget.ListView;
-import android.widget.Toast;
public class DirectoryPicker extends ListActivity {
@@ -45,20 +47,24 @@
public static final String CHOSEN_DIRECTORY = "chosenDir";
public static final int PICK_DIRECTORY = 43522432;
private File dir;
+ private boolean showHidden = false;
+ private boolean onlyDirs = true ;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle extras = getIntent().getExtras();
dir = Environment.getExternalStorageDirectory();
- String preferredStartDir = extras.getString(START_DIR);
- final boolean showHidden = extras.getBoolean(SHOW_HIDDEN, false);
- final boolean onlyDirs = extras.getBoolean(ONLY_DIRS, true);
- if(preferredStartDir != null) {
- File startDir = new File(preferredStartDir);
- if(startDir.isDirectory()) {
- dir = startDir;
- }
+ if (extras != null) {
+ String preferredStartDir = extras.getString(START_DIR);
+ showHidden = extras.getBoolean(SHOW_HIDDEN, false);
+ onlyDirs = extras.getBoolean(ONLY_DIRS, true);
+ if(preferredStartDir != null) {
+ File startDir = new File(preferredStartDir);
+ if(startDir.isDirectory()) {
+ dir = startDir;
+ }
+ }
}
setContentView(R.layout.chooser_list);