/android/import-contacts

To get this branch, use:
bzr branch http://bzr.ed.am/android/import-contacts

« back to all changes in this revision

Viewing changes to src/org/waxworlds/edam/importcontacts/FileChooser.java

  • Committer: edam
  • Date: 2010-10-28 16:12:57 UTC
  • Revision ID: edam@waxworlds.org-20101028161257-9stn23tn7tvkkjno
- fixed bug where a file chooser wouldn't know it's context when the context was used

Show diffs side-by-side

added added

removed removed

5
5
 *
6
6
 * This file is part of the Import Contacts program (hereafter referred
7
7
 * to as "this program"). For more information, see
8
 
 * http://www.waxworlds.org/edam/software/android/export-contacts
 
8
 * http://www.waxworlds.org/edam/software/android/import-contacts
9
9
 *
10
10
 * This program is free software: you can redistribute it and/or modify
11
11
 * it under the terms of the GNU General Public License as published by
137
137
 
138
138
 
139
139
        // constructor
140
 
        public FileChooser()
 
140
        public FileChooser( Context context )
141
141
        {
 
142
                _context = context;
142
143
        }
143
144
 
144
145
        public void setMode( int mode )
194
195
                return _path + _filename;
195
196
        }
196
197
 
197
 
        public Dialog onCreateDialog( Context context )
 
198
        public Dialog onCreateDialog()
198
199
        {
199
 
                _context = context;
200
 
 
201
200
                // custom layout in an AlertDialog
202
 
                LayoutInflater factory = LayoutInflater.from( context );
 
201
                LayoutInflater factory = LayoutInflater.from( _context );
203
202
                final View dialogView = factory.inflate(
204
203
                        R.layout.filechooser, null );
205
204
 
210
209
                        .setOnItemClickListener( _fileChooserItemClickListener );
211
210
 
212
211
                // return dialog
213
 
                Dialog dialog = new AlertDialog.Builder( context )
 
212
                Dialog dialog = new AlertDialog.Builder( _context )
214
213
                        .setTitle( " " )
215
214
                        .setView( dialogView )
216
215
                        .create();