mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-25 23:10:47 -08:00
Simplify handling of command-line arguments on Android
* java/org/gnu/emacs/EmacsActivity.java (EXTRA_STARTUP_ARGUMENTS): New constant. (onCreate): Read a string array, not a string extra from the intent with this key. * java/org/gnu/emacs/EmacsOpenActivity.java (EmacsOpenActivity) <fileToOpen>: Delete field. (onCreate): Provide file name as a command line argument when starting the Emacs service. * java/org/gnu/emacs/EmacsPreferencesActivity.java (startEmacsQ) (startEmacsDebugInit): In like manner, replace ad-hoc command-line argument extra with a proper array. * java/org/gnu/emacs/EmacsService.java (EmacsService): Rename extraStartupArgument to extraStartupArguments, and change its type to a string array. (onCreate): Adjust to match. * java/org/gnu/emacs/EmacsThread.java (EmacsThread) <extraStartupArguments>: Ditto. <fileToOpen>: Delete field. (run): Adjust correspondingly.
This commit is contained in:
parent
ecfbd0ff99
commit
41dd78cd36
5 changed files with 32 additions and 41 deletions
|
|
@ -57,7 +57,8 @@ public class EmacsPreferencesActivity extends PreferenceActivity
|
|||
intent = new Intent (this, EmacsActivity.class);
|
||||
intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
| Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
intent.putExtra ("org.gnu.emacs.STARTUP_ARGUMENT", "--quick");
|
||||
intent.putExtra (EmacsActivity.EXTRA_STARTUP_ARGUMENTS,
|
||||
new String[] {"--quick", });
|
||||
startActivity (intent);
|
||||
System.exit (0);
|
||||
}
|
||||
|
|
@ -74,7 +75,8 @@ public class EmacsPreferencesActivity extends PreferenceActivity
|
|||
intent = new Intent (this, EmacsActivity.class);
|
||||
intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
| Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
intent.putExtra ("org.gnu.emacs.STARTUP_ARGUMENT", "--debug-init");
|
||||
intent.putExtra (EmacsActivity.EXTRA_STARTUP_ARGUMENTS,
|
||||
new String[] {"--debug-init", });
|
||||
startActivity (intent);
|
||||
System.exit (0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue