Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Changed the way of listing of apps
The apps in case of Info-apps, Quiz apps, and Spellings app were
displayed as filenames, which included the extension part too. For
example, science.txt, prepositions.txt. This was fixed.
  • Loading branch information
srujanjha committed Mar 8, 2015
commit a5465be14ac5b0bf505822e7cdb049f871dfb52a
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void onItemClick(AdapterView<?> parent, View view, int position,

switch (option) {
case 0:
fileName = "info/" + mFileNameList.get(position);
fileName = "info/" + mFileNameList.get(position)+".txt";

break;
case 1:
Expand All @@ -73,11 +73,11 @@ public void onItemClick(AdapterView<?> parent, View view, int position,
break;
case 2:

fileName = "quiz/" + mFileNameList.get(position);
fileName = "quiz/" + mFileNameList.get(position)+".txt";
break;
case 3:

fileName = "spellings/" + mFileNameList.get(position);
fileName = "spellings/" + mFileNameList.get(position)+".txt";
break;

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public static ArrayList<String> listFiles(Context context, String dirFrom) {
if (fileList != null) {
for (int i = 0; i < fileList.length; i++) {
Log.d("", fileList[i]);
mFileList.add(fileList[i]);
if(fileList[i].endsWith(".txt"))mFileList.add(fileList[i].substring(0,fileList[i].length()-4));
else
mFileList.add(fileList[i]);
}
}
} catch (IOException e) {
Expand Down