Hi guys,

I have a function in my activity that starts a new thread and that
threads send a message back to an event handler. I need to start an
activity after that thread finishes. How can I do that. I keep getting
an error when I try to do this :

class mainClass extends Activity {


        Handler guiUpdateHandler = new Handler() {
                @Override
                public void handleMessage(Message msg) {
                        switch (msg.what) {
                        case LOGGED_IN:
                                try {
                                      // i get an error here.
                                     // it says i cant use
mainClass.this for the first param.
                                        Intent inte = new 
Intent(mainClass.this, newIntent.class);
                                        inte.
                                        Bundle bun = new Bundle();
                                        bun.putCharSequence("user", user);
                                        bun.putCharSequence("pass", pass);
                                        bun.putCharSequence("sid", sid);
                                        gallery.putExtra("data", bun);
                                        StartActivity(newIntent);
                                } catch (Exception e) {
                                        Log.e("ASDASD", e.toString());
                                }

                                break;

        public void login(String lUser, String lPass) {
                Thread t = new Thread() {
                        public void run() {
                                loginThread(user,pass);
                        }
                };
                t.start();
        }
        public void loginThread(String lUser, String lPass) {
        Message message = new Message();
        message.what = iyobo.SOME_CONST;
        iyobo.this.guiUpdateHandler.sendMessage(message);
     }
}

Please let me know if my question is unclear. Thanks in advance,
Moazzam Khan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to