(Phoenix) Can now go back to 'Select libretro core' from 'select

ROM' menu by pressing Back button by returning RESULT_CANCELED
from DirectoryActivity
This commit is contained in:
twinaphex 2012-12-10 19:13:39 +01:00
parent 31ba3e251e
commit 10483e08e1
1 changed files with 13 additions and 4 deletions

View File

@ -179,11 +179,20 @@ public class DirectoryActivity extends Activity implements AdapterView.OnItemCli
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if(keyCode == KeyEvent.KEYCODE_BACK && backStack.size() > 1)
if(keyCode == KeyEvent.KEYCODE_BACK)
{
backStack.remove(backStack.size() - 1);
wrapFiles();
return true;
if(backStack.size() > 1)
{
backStack.remove(backStack.size() - 1);
wrapFiles();
}
else
{
Intent intent=new Intent();
setResult(RESULT_CANCELED, intent);
finish();
}
return true;
}
return super.onKeyDown(keyCode, event);