Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8633511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:30:14+00:00 2026-06-12T09:30:14+00:00

Now i am developing one in that useing Async Task Iam facing this Errors,

  • 0

Now i am developing one in that useing Async Task Iam facing this Errors, Any one have idea of this..

10-03 19:04:55.662: E/AndroidRuntime(1547): FATAL EXCEPTION: Thread-11
10-03 19:04:55.662: E/AndroidRuntime(1547): java.lang.ExceptionInInitializerError
10-03 19:04:55.662: E/AndroidRuntime(1547):     at com.cc.accounts.ChatAccountsFragment.Gtalk_logInComplete(ChatAccountsFragment.java:579)
10-03 19:04:55.662: E/AndroidRuntime(1547):     at com.cc.xmpp.GmailXmppClient.Login(GmailXmppClient.java:92)
10-03 19:04:55.662: E/AndroidRuntime(1547):     at com.cc.accounts.ChatAccountsFragment$5.run(ChatAccountsFragment.java:482)
10-03 19:04:55.662: E/AndroidRuntime(1547):     at java.lang.Thread.run(Thread.java:1096)
10-03 19:04:55.662: E/AndroidRuntime(1547): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
10-03 19:04:55.662: E/AndroidRuntime(1547):     at android.os.Handler.<init>(Handler.java:121)
10-03 19:04:55.662: E/AndroidRuntime(1547):     at android.os.AsyncTask$InternalHandler.<init>(AsyncTask.java:421)
10-03 19:04:55.662: E/AndroidRuntime(1547):     at android.os.AsyncTask$InternalHandler.<init>(AsyncTask.java:421)
10-03 19:04:55.662: E/AndroidRuntime(1547):     at android.os.AsyncTask.<clinit>(AsyncTask.java:152)
10-03 19:04:55.662: E/AndroidRuntime(1547):     ... 4 more

this is Async Task

public void Gtalk_logInComplete(String Uname, XMPPConnection _connection) {
      Log.i(TAG, "Uname" +Uname);
      Uname = current_username;
      _connection = current_connection;
      ForwardAction task = new ForwardAction(); // this is line no 579
      task.execute();    
}

private class ForwardAction extends AsyncTask<Void, Void, Void> {          
    private ArrayList<String> contactJids;
    private GmailXmppClient Gtalk_xmpp_client;
    private ArrayList<String> contactNames;

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        show();
    }

    protected Void doInBackground(Void... params) {

 //         new Thread() {
 //             public void run() {

                synchronized (this.contactJids) {
                    Roster roster = this.Gtalk_xmpp_client.getRoster();
                    String file_name;
                    for (RosterEntry entry : roster.getEntries()) {
                        if (entry.getType() == ItemType.to || entry.getType() == ItemType.both) {

                            this.contactJids.add(entry.getUser());
                            this.contactNames.add(entry.getName());                         

                            contact_db.open();
                            boolean yes = contact_db.checkUsername(entry.getUser());
                            Log.i(TAG, "Con=" + yes);
                            if (!yes) {

                                Bitmap buddy_img = buddyImage(entry, current_connection);
                                if (buddy_img != null)
                                    file_name = Store(buddy_img);
                                else
                                    file_name = "";
                                if (entry.getName() == null)
                                    contact_db.createContact(entry.getUser(), entry.getUser(), current_username, file_name, "GOOGLE");
                                else
                                    contact_db.createContact(entry.getName(), entry.getUser(), current_username, file_name, "GOOGLE");
                            } else {
                                Log.i(TAG, "Con=exist");
                            }
                        }
                    }
                } 
    //      }
//      }.start();                      
        contact_db.close();         
        return null;
    }

    protected void onPostExecute(Void aVoid) {          
        super.onPostExecute(aVoid);       
        hide();
    }        
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:30:15+00:00Added an answer on June 12, 2026 at 9:30 am

    This error happens when you try to update a view from a thread which you can’t do. You’ll either need to update your view from onPostExecute or use runOnUiThread to update your view.

    You can use runOnUiThread as follows:

    runOnUiThread(new Runnable() {
        public void run() {                     
            // your code to update the UI thread here               
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just starting web-developing now (I do have experience with C#). And I've seen
I have 4 years experience on DotNet, not much. I now learned developing for
i'm new at IPhone SDK Developing and now i need some help. I have
I am developing one application that requires records from Addressbook , I need all
I am developing a framework for reproducible computing with R. One problem that I
I am developing one application, right now i am on designing phase. i design
We're currently developing some functionality for our program that needs OpenCV. One of the
I am developing a wizard using Formwizard that matches one model. Also due to
I'm developing a class library that implements a protocol stack. There I have an
Okay so I have been developing a system so far in main memory that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.