问题
i want create a button that starts the new screenrecording feature in Android 4.4 Kit Kat.. I create a button and i tryied to do in this way:
start.setOnClickListener(new OnClickListener() {
public void onClick(View v){
String record ="su screenrecord — bit rate 8000000 --time-limit 30 "+recordfolder+"Record.mp4";
recordfolder.mkdir();
try {
Process screenrecording = Runtime.getRuntime().exec(record);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
It creates the dir when i click but the recording not starts. My question are two right now;
1) Why i can't start the recording?
2) Which is the "stop" command? I see that you have to click CTRL+C
but i can't do it in android phone.. I need an adb command possibly.
3) If possible create a countdown before start the record.
About the 3 point, i created a counter: int i=0, second = 5;
but i don't know how proceed. Thanks
来源:https://stackoverflow.com/questions/20326522/screen-recording-kitkat-with-button