import android.os.Bundle;
import android.os.Handler;
import android.os.PowerManager;
+import android.os.SystemClock;
import android.os.Vibrator;
import android.preference.PreferenceManager;
import android.provider.BaseColumns;
new Thread(new Runnable() {
@Override
public void run() {
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- //ignored
- }
+ SystemClock.sleep(2000);
handler.post(new Runnable() {
@Override
public void run() {
- camera.takePicture(null, null, new FonBotPictureCallback(context, replyTo, hostname, port));
+ try {
+ camera.takePicture(null, null, new FonBotPictureCallback(context, replyTo, hostname, port));
+ } catch(Exception e){
+ Utils.sendMessage(context, replyTo, error_while_processing_command, e.getClass().getName(), e.getMessage());
+ }
}
});
}