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?
精彩评论