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 8119981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:58:43+00:00 2026-06-06T04:58:43+00:00

i’ve built a BaseAdapter extended class for my list view.. inside i have a

  • 0

i’ve built a BaseAdapter extended class for my list view..

inside i have a TextView field which i want to set by code.
this field represent a facebook status of the user.

this field sometimes gets a text in hebrew, and then it crashes by stackoverflow error.

important to add that this ain’t happened when the text the field gets is in english,
and when i’ve tried to debug it to find the problem, i’ve used setText with hebrew string inside an activity (not a BaseAdapter) and it worked fine.

this is my class:

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;    
import com.WhosAround.R;
import com.WhosAround.AppVariables;    
import com.WhosAround.Facebook.FacebookUser;
import com.facebook.android.AsyncFacebookRunner.RequestListener;
import com.facebook.android.FacebookError;    
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;  

public class FriendsFriendsTabList extends BaseAdapter {

    private static LayoutInflater inflater = null;
    private AppVariables app;
    private final FacebookUser[] chatList;

    public FriendsFriendsTabList(Activity activity) {
        inflater = (LayoutInflater) activity
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        app = (AppVariables) activity.getApplicationContext();
        chatList = app.makeApplicationFacebookUsersArray();
    }

    public int getCount() {
        return chatList.length;
    }

    public Object getItem(int position) {
        return position;
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(final int position, View convertView, ViewGroup parent) {
        View vi = convertView;
        if (convertView == null)
            vi = inflater.inflate(
                    R.layout.activity_friends_friends_tab_list_row, null);
        if (position % 2 == 0)
            vi.setBackgroundResource(R.color.list_background_light);
        else
            vi.setBackgroundResource(R.color.list_background_dark);

        TextView name = (TextView) vi
                .findViewById(R.id.list_friends_friends_tab_name);
        TextView status = (TextView) vi
                .findViewById(R.id.list_friends_friends_tab_status);
        ImageView profilePicture = (ImageView) vi
                .findViewById(R.id.list_profile_picture);   
        loadStatus(position, status);

        return vi;
    }


    private void loadStatus(final int position, final TextView status) {
        if (chatList[position].getStatus() != null)
            status.setText(chatList[position].getStatus());
        else {
            final Handler handler = new Handler() {
                @Override
                public void handleMessage(Message message) {                    
                    try {
                        String currentStatus = (String) message.obj;
                        String utf8Status;
                        utf8Status = new String(currentStatus.getBytes(), "UTF-8");
                        chatList[position].setStatus(currentStatus);                    
                        Log.d("status", chatList[position].getStatus()); 
                                                      //this is the line that causes the error
status.setText(utf8Status);

                    } catch (UnsupportedEncodingException e) {
                        e.printStackTrace();
                    }
                }
            };

            Thread thread = new Thread() {
                @Override
                public void run() {
                    String fqlQuery = "SELECT message FROM status WHERE uid="
                            + Integer.toString(chatList[position].getId())
                            + " LIMIT 1";                    
                     Bundle fqlQueryParams = new Bundle();
                     fqlQueryParams.putString("method", "fql.query");
                     fqlQueryParams.putString("query", fqlQuery);                                       
                    app.getFacebookManager().getFacebookRunner().request(null, fqlQueryParams, new RequestListener() {

                        @Override
                        public void onMalformedURLException(MalformedURLException e, Object state) {
                            Log.e("Facebook User Status", e.toString());
                        }

                        @Override
                        public void onIOException(IOException e, Object state) {
                            Log.e("Facebook User Status", e.toString());                            
                        }

                        @Override
                        public void onFileNotFoundException(FileNotFoundException e, Object state) {
                            Log.e("Facebook User Status", e.toString());                            
                        }

                        @Override
                        public void onFacebookError(FacebookError e, Object state) {
                            Log.e("Facebook User Status", e.toString());                            
                        }

                        @Override
                        public void onComplete(String response, Object state) {
                            Log.d("Facebook Response", response);
                            JSONArray statusResults = app.convertToJSONArray(response);
                            try {
                                JSONObject statusObject = statusResults.getJSONObject(0);
                                String currentStatus = statusObject.getString("message");                                                               
                                Message message = handler.obtainMessage(1, currentStatus);
                                handler.sendMessage(message);
                            } catch (JSONException e) {
                                Log.e("Facebook User Status", e.toString());
                            } 

                        }
                    });

                }
            };
            thread.start();
        }
    }

}

i know the code is a bit mass, and that i should use asynctask instead of thread and handlers, but this is only a test, and i wanted to see if it works…

stacktrace:

06-20 19:30:15.180: E/AndroidRuntime(3863): FATAL EXCEPTION: main
06-20 19:30:15.180: E/AndroidRuntime(3863): java.lang.StackOverflowError
06-20 19:30:15.180: E/AndroidRuntime(3863):     at com.ibm.icu4jni.util.LocaleData.get(LocaleData.java:96)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at java.util.Formatter.format(Formatter.java:1061)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at java.util.Formatter.format(Formatter.java:1031)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at java.lang.String.format(String.java:2183)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at java.lang.String.format(String.java:2157)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.text.Styled.drawDirectionalRun(Styled.java:266)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.text.Styled.drawText(Styled.java:362)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.text.Layout.drawText(Layout.java:1546)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.text.Layout.draw(Layout.java:380)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.widget.TextView.onDraw(TextView.java:4417)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.View.draw(View.java:6933)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.View.draw(View.java:6936)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.widget.AbsListView.dispatchDraw(AbsListView.java:1648)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.widget.ListView.dispatchDraw(ListView.java:3217)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.View.draw(View.java:6936)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.widget.AbsListView.draw(AbsListView.java:3030)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.View.draw(View.java:6936)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.widget.FrameLayout.draw(FrameLayout.java:357)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.View.draw(View.java:6936)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.widget.FrameLayout.draw(FrameLayout.java:357)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.View.draw(View.java:6936)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.widget.FrameLayout.draw(FrameLayout.java:357)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.View.draw(View.java:6936)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.widget.FrameLayout.draw(FrameLayout.java:357)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.View.draw(View.java:6936)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.widget.FrameLayout.draw(FrameLayout.java:357)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1917)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewRoot.draw(ViewRoot.java:1530)
06-20 19:30:15.180: E/AndroidRuntime(3863):     at android.view.ViewRoot.perfor
  • 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-06T04:58:44+00:00Added an answer on June 6, 2026 at 4:58 am

    Are you sure your

    status.setText(utf8Status)
    

    is running on the UI Thread? It may not be because of the Threaded Handler. You’ll need to try running that as a POST.
    However, that usually results in a different error message.

    Can you please point out which part of the code it line 96? The one causing the error?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is

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.