Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
package com.cognizant.android.PhoneContentSearch; import java.io.File; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import android.app.AlertDialog; import android.app.ListActivity; import android.content.DialogInterface; import android.content.Intent; import android.content.DialogInterface.OnClickListener; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.net.ContentURI; import android.os.Bundle; import android.view.View; import android.widget.ListView; public class SearchAllFiles extends ListActivity { private List directoryEntries = new ArrayList(); private List searchEntries = new ArrayList(); private File currentDirectory = new File("/"); private String[] search_text; private String folder_type; private boolean filter_dir = true; private boolean disable_onlistclick=false; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); browseToRoot(); this.setTitleColor(Color.TRANSPARENT); this.setTheme(android.R.style.Theme_Dialog); Bundle bundle = getIntent().getExtras(); if (bundle != null) { search_text = bundle.getStringArray(AllFiles.file_type); folder_type = bundle.getString(AllFiles.folder_type); if (search_text != null) { SearchForDirectory(search_text); } } this.setResult(AllFiles.search); this.finishSubActivity(AllFiles.search); } /** * This function browses to the root-directory of the file-system. */ private void browseToRoot() { filterFiles(new File("/")); } private void browseTo(final File aDirectory) { if (!(aDirectory.isDirectory())) { OnClickListener okButtonListener = new OnClickListener() { // @Override public void onClick(DialogInterface arg0, int arg1) { try { // Lets start an intent to View the file, that was // clicked... Intent myIntent = new Intent( android.content.Intent.VIEW_ACTION, new ContentURI("file://" + aDirectory.getAbsolutePath())); startActivity(myIntent); } catch (URISyntaxException e) { e.printStackTrace(); } } }; OnClickListener cancelButtonListener = new OnClickListener() { // @Override public void onClick(DialogInterface arg0, int arg1) { // Do nothing } }; AlertDialog.show(this, "Question", "Do you want to open this file?n" + aDirectory.getName(), "OK", okButtonListener, "Cancel", cancelButtonListener, false, null); } } //Filter the files. //forbidden_folders = { "/sys", "/dev", "/proc", "etc" }; private void filterFiles(final File aDir) { File[] filesAndDirs = aDir.listFiles(); List filesDirs = Arrays.asList(filesAndDirs); List updatedDir = new ArrayList(); if (filter_dir) { for (File file : filesDirs) { if (!((file.getPath().equals("/sys")) || (file.getPath().equals("/dev")) || (file.getPath().equals("/proc")) || (file.getPath() .equals("/etc")))) { updatedDir.add(file); } } } for (File file : updatedDir) { fillFiles(file); } } //Recursive loop to populate the files. //Not a fast method :cry: private List fillFiles(final File aDir) { this.currentDirectory = aDir; int currentDirectoryLength = this.currentDirectory.getAbsolutePath() .length(); File[] filesAndDirs = aDir.listFiles(); if (filesAndDirs != null) { List filesDirs = Arrays.asList(filesAndDirs); for (File file : filesDirs) { this.directoryEntries.add(file.getAbsolutePath().substring( currentDirectoryLength+1)); if (file.isDirectory()) { fillFiles(file); } } } Collections.sort(this.directoryEntries); return this.directoryEntries; } // Search for the file type protected void SearchForDirectory(String[] searchText) { this.searchEntries.clear(); Drawable currentIcon = null; for (String filetype : searchText) { for (Iterator iterator = directoryEntries.iterator(); iterator .hasNext();) { String type = (String) iterator.next(); if (type.contains(filetype)) { if (checkEndsWithInStringArray(type, getResources() .getStringArray(R.array.fileEndingImage))) { currentIcon = getResources().getDrawable( R.drawable.image); } else if (checkEndsWithInStringArray(type, getResources() .getStringArray(R.array.fileEndingWebText))) { currentIcon = getResources().getDrawable( R.drawable.webpage); } else if (checkEndsWithInStringArray(type, getResources() .getStringArray(R.array.fileEndingAudio))) { currentIcon = getResources().getDrawable( R.drawable.audio); } else if (checkEndsWithInStringArray(type, getResources() .getStringArray(R.array.fileEndingApp))) { currentIcon = getResources().getDrawable( R.drawable.icon1); } else if (checkEndsWithInStringArray(type, getResources() .getStringArray(R.array.fileEndingVideo))) { currentIcon = getResources().getDrawable( R.drawable.video); } else { currentIcon = getResources().getDrawable( R.drawable.text); } searchEntries.add(new IconifiedText(type, currentIcon)); } } if (!(this.searchEntries.isEmpty())) { IconifiedTextListAdapter itla = new IconifiedTextListAdapter( this); itla.setListItems(this.searchEntries); this.setListAdapter(itla); } else { disable_onlistclick=true; //this.setDefaultKeyMode(DISABLE_DEFAULT_KEYS); currentIcon=getResources().getDrawable(R.drawable.sadsmiley); String no_match="Sorry! No matches for " + folder_type; this.searchEntries.add(new IconifiedText(no_match, currentIcon)); IconifiedTextListAdapter itlanomatch = new IconifiedTextListAdapter( this); itlanomatch.setListItems(this.searchEntries); this.setListAdapter(itlanomatch); } } } /** * Checks whether checkItsEnd ends with one of the Strings from fileEndings */ private boolean checkEndsWithInStringArray(String checkItsEnd, String[] fileEndings) { for (String aEnd : fileEndings) { if (checkItsEnd.endsWith(aEnd)) return true; } return false; } @Override protected void onListItemClick(ListView l, View v, int position, long id) { int selectionRowID = (int) this.getSelectionRowID(); File clickedFile = new File(this.currentDirectory.getAbsolutePath()+this.directoryEntries.get(selectionRowID)); if (clickedFile != null && !disable_onlistclick){ this.browseTo(clickedFile); } } }