所以我有一个遵循以下布局的应用程序模块:
defmodule Project.Application do
use Application
def start(_type, _args) do
children = [
randomchild1,
randomchild2,
{Project.runapp, "argument" }
]
opts = [strategy: :one_for_all, name: Project.Supervisor]
Supervisor.start_link(children, opts)
end
end
Run Code Online (Sandbox Code Playgroud)
现在,当我运行它时,我使用它mix run --no-halt并且运行完美。
我想用在命令行中传递的值替换“参数”?我不知道如何向mix run --no-halt.
我想做的就是将一个值传递给 start 方法并使用它来定义子进程。
我试图列出我的Android模拟器的特定文件夹中的所有文件,我一直得到空答案.
继承我的代码:
File sdCardRoot = Environment.getExternalStorageDirectory();
File[] file= new File(sdCardRoot+"path");
for (File f : file.listFiles()) {
if (f.isFile())
String name = f.getName();
}
Run Code Online (Sandbox Code Playgroud)
这似乎不起作用,不知道为什么.