Hello everybody again,

Now my code runs in background anfd on foreground it shows progress
bar.But now I want to show another screen after sendFileToServer
method completes. I had tried followinfg but throws exception. Please
help me how to to do this?

 public void onClick(View v)
    {
        if (v==yesButton)
                {
                setContentView(R.layout.main2);

                t = new Thread(){
                           public void run()
                           {
                                   while (!threadDone)
                                   {
                                           sendFileToServer();

                                   }
                                   setContentView(R.layout.main3);
                           }
                        };

                        t.start();

                }
    }

    public void sendFileToServer()
    {
        for (int i=0;i<5000;i++)
        {

                System.out.println ("Now value of i is"+i);
        }
        threadDone = true;


    }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to