Ok I'm learning how shell commands work, so I decided to develop a app to send the commands. This is what I got.
moveDirectory.setOnClickListener(new OnClickListener(){
public void onClick(View v)
{
try{
Process send = Runtime.getRunetime().exec(new String[] {"cd /sdcard/music/", "cp pic1 /sdcard/pic1"});
send.waitFor();
} catch (Exception ex){
String toast = null;
Log.i(toast, "Couldn't copy file", ex);
}
}
});
But it isn't working, the first command is working, but not the second one. What should I add to it?
Thanks
EDIT: forgot to add the send.waitFor(); line