Android File Manager automatically exits when the folder path is returned to the N-19 layer from the N-tier by pressing the back key

Source: Internet
Author: User

When the folder path is returned from N-tier to the N-19 layer, the file manager exits automatically, such as when the 63-level press back key returns to level 44, the file manager exits automatically.

1.FileManager Default Design, FileManager records only up to 20 operation paths, if exceeded, will delete the oldest record. Your company can refer to this part of the code in Alps/mediatek/packages/apps/filemanager/src/com/mediatek/filemanager/fileinfomanager.java.
/** Max History Size */
private static final int max_list_size = 20;
Private final list<navigationrecord> mnavigationlist = new linkedlist<navigationrecord> ();
/**
* This method gets the previous navigation directory path
*
* @return the previous navigation path
*/
Protected Navigationrecord getprevnavigation () {
while (!mnavigationlist.isempty ()) {
Navigationrecord Navrecord = Mnavigationlist.get (Mnavigationlist.size ()-1);
Removefromnavigationlist ();
String path = Navrecord.getrecordpath ();
if (! Textutils.isempty (path)) {
if (new File (path). Exists () | | Mountpointmanager.getinstance (). Isrootpath (path)) {
return Navrecord;
}
}
}
return null;
}
/**
* This method adds a navigationrecord to the navigation
*
* @param navigationrecord the Record
*/
protected void Addtonavigationlist (Navigationrecord navigationrecord) {
if (Mnavigationlist.size () <= max_list_size) {
Mnavigationlist.add (Navigationrecord);
} else {
Mnavigationlist.remove (0);
Mnavigationlist.add (Navigationrecord);
}
}
/**
* This method removes a directory path from the navigation
*/
protected void Removefromnavigationlist () {
if (!mnavigationlist.isempty ()) {
Mnavigationlist.remove (Mnavigationlist.size ()-1);
}
}


2. For the history record of 20 operating paths, you can modify the Max_list_size to set the maximum number of path records required in FileInfo.Manager.java. The effect of this modification is that the File Manager apk may use more memory because the list<navigationrecord> mnavigationlist needs to record more paths.
This part of the code in Alps/mediatek/packages/apps/filemanager/src/com/mediatek/filemanager/fileinfomanager.java.
/** Max History Size */
private static final int max_list_size = XXX;

Android File Manager exits automatically when the folder path is returned to the N-19 layer by pressing the back key from N-tier

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.