Skip to content

ingyesid/simple-file-chooser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

simple-file-chooser

Little library for choose file from SDCard in android 2.2+

Home Home Home

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();
    }                   
}

}

About

Little library for choose file from SDCard in android 2.2+

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages