开发者

Start camera activity in a thread and it runs twice

I am using a thread, (tested Runnable, Asynch) to implement a delay and then start camera activity, but the problem is after taking a pic and returing back camera is launched again, so my camera activity is lunched twice, what could be the sol. I have used Runnable as well for implementing thread. Thanks.

                  public void onCreate(Bundle savedInstanceState) {
                  Thread_as obj=new Threads_as();
                  obj.execute("");
                   }
                      ............

                  doInBack开发者_运维技巧ground(){
                  int timer=0;
            while(timer<2000)
            {
                Thread.sleep(100);
                timer+=100;
            }}
   onPostExecute(){
    Intent it=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);          
        startActivity(it);

}


Do you run the AsyncTask every time the original activity is started?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜