simple-file-chooser

Additional

Language
Java
Version
N/A
Created
Jun 25, 2013
Updated
Jun 26, 2013 (Retired)
Owner
Yesid Lázaro Mayoriano (ingyesid)
Contributor
Yesid Lázaro Mayoriano (ingyesid)
1
Activity
Badge
Generate
Download
Source code

Promotion

simple-file-chooser

Little library for choose file from SDCard in android 2.2+

HOW TO USE

-- Add the library reference to your project --

public class MainActivity extends Activity {

final int FILE_CHOOSER=1; 
@Override
protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 Intent intent = new Intent(MainActivity.this, FileChooserActivity.class);
 startActivityForResult(intent, FILE_CHOOSER);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
 
 getMenuInflater().inflate(R.menu.main, menu);
 return true;
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if ((requestCode == FILE_CHOOSER) && (resultCode == RESULT_OK)) {
        String fileSelected = data.getStringExtra(Constants.KEY_FILE_SELECTED);
        Toast.makeText(this, "file selected "+fileSelected, Toast.LENGTH_SHORT).show();
    }                   
}

}