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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:42:16+00:00 2026-05-26T15:42:16+00:00

I am getting an error in my code while i try to show the

  • 0

I am getting an error in my code while i try to show the list of data what i have received from server using json for communicating with wcf webservices.

I am getting response from webservice and the data is added to list also but i am not getting why i am getting this error.Please guide me to resolve the error

Here is the logcat output :

11-08 13:57:29.668: ERROR/AndroidRuntime(1386): Uncaught handler: thread main exiting due to uncaught exception

11-08 13:57:29.678: ERROR/AndroidRuntime(1386): java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.widget.AdapterView.addView(AdapterView.java:461)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at com.ecommerce.balajeebazaar.CategoryListAdapter.getView(CategoryListAdapter.java:64)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.widget.AbsListView.obtainView(AbsListView.java:1273)
11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     
                             at android.widget.ListView.measureHeightOfChildren(ListView.java:1147)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.widget.ListView.onMeasure(ListView.java:1060)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.view.View.measure(View.java:7703)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:350)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.view.View.measure(View.java:7703)
11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     
                             at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.view.View.measure(View.java:7703)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.view.View.measure(View.java:7703)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at android.view.View.measure(View.java:7703)
11-08 13:57:29.678: ERROR/AndroidRuntime(1386):    
                             at android.view.ViewRoot.performTraversals(ViewRoot.java:747)
11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     
                             at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)
11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:99)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386): at android.os.Looper.loop(Looper.java:123)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386): at android.app.ActivityThread.main(ActivityThread.java:4203)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):  at java.lang.reflect.Method.invokeNative(Native Method)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):  at java.lang.reflect.Method.invoke(Method.java:521)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)

11-08 13:57:29.678: ERROR/AndroidRuntime(1386):     at dalvik.system.NativeStart.main(Native Method)

And the code of my java file is :

CategoryArray = CW.CategoryWebservice("http://www.balajeebazaar.com/RestServiceImpl.svc/categorydetails");

for(int i = 0;i<=CategoryArray.length()-1;i++){
            try {
                Log.v("Categories :- ", CategoryArray.getString(i)+"");
                String[] val = new String[3];
                val = CategoryArray.getString(i).split(",");
                Log.v("val[0] :  ", val[0]);
                Log.v("val[1]  :", val[1]);
                CategoryList.add(i, val[0]+" "+val[1]);
                val = null;
                Log.v("CATEGORY LIST", CategoryList.get(i).toString());
            } catch (JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        //CategoryList.size();
        adapter = new CategoryListAdapter(CategoryActivity.this, CategoryList);

The code for my CategoryListAdapter class is :

public class CategoryListAdapter extends BaseAdapter {
    private Activity activity;
    // private String[] data;
    private ArrayList<String> CategoryList = new ArrayList<String>();
    private static LayoutInflater inflater = null;

    // public ImageLoader imageLoader;

    public CategoryListAdapter(Activity a, ArrayList<String> categorylist) {
        activity = a;
        // data = d;
        inflater = (LayoutInflater) activity
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        CategoryList = categorylist;
        // imageLoader=new ImageLoader(activity.getApplicationContext());
    }

    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        return CategoryList.size();
    }

    @Override
    public Object getItem(int position) {
        // TODO Auto-generated method stub
        return position;
    }

    @Override
    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return position;
    }

    public static class ViewHolder {
        public TextView text;
        public ImageView image;
    }

Code Edit :

@Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        View vi;
        ViewHolder holder;
        if (convertView == null) {
            vi = new View(activity);
            LayoutInflater inflater = activity.getLayoutInflater();
            vi = inflater.inflate(R.layout.item, null, true);
            holder = new ViewHolder();
            holder.text = (TextView) vi.findViewById(R.id.text);
            holder.image = (ImageView) vi.findViewById(R.id.image);
            vi.setTag(holder);
        } else {
            vi = convertView;
            holder = (ViewHolder) vi.getTag();
            holder.text.setText(CategoryList.get(position).toString());
            holder.image.setTag(R.drawable.go_arrow);
        }
        holder.text.setText(CategoryList.get(position).toString());
        holder.image.setTag(R.drawable.go_arrow);
        vi.setTag(holder);
        return vi;
    }
}

I edited the getView Function as ablove (see my code edit)
and it worked thanx everybody for replying

  • 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-05-26T15:42:16+00:00Added an answer on May 26, 2026 at 3:42 pm

    Try this CategoryListAdapter replace at yours, and let me know what happen,

    EDIT:

       public class CategoryListAdapter extends BaseAdapter {
        private Activity activity;
        // private String[] data;
        private ArrayList<String> CategoryList = new ArrayList<String>();
    
        public CategoryListAdapter(Activity a, ArrayList<String> categorylist) {
            activity = a;
            CategoryList = categorylist;
    
        }
    
        @Override
        public int getCount() {
            // TODO Auto-generated method stub
            return CategoryList.size();
        }
    
        @Override
        public Object getItem(int position) {
            // TODO Auto-generated method stub
            return position;
        }
    
        @Override
        public long getItemId(int position) {
            // TODO Auto-generated method stub
            return position;
        }
    
        public static class ViewHolder {
            public TextView text;
            public ImageView image;
        }
    
         @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            // TODO Auto-generated method stub
            View vi;
            ViewHolder holder;
            if (convertView == null) {
                LayoutInflater inflater =getLayoutInflater();
                vi = inflater.inflate(R.layout.item, parent);
                holder = new ViewHolder();
                holder.text = (TextView) vi.findViewById(R.id.text);
                holder.image = (ImageView) vi.findViewById(R.id.image);
                vi.setTag(holder);
            } else{
                      vi = convertView;
                       holder = (ViewHolder) vi.getTag();
                      }
            String texttoappend = CategoryList.get(position);
            Log.v("texttoappend", texttoappend);
            holder.text.setText(CategoryList.get(position).toString());
            holder.image.setTag(R.drawable.go_arrow);
            // imageLoader.DisplayImage(data[position], activity, holder.image);
            return vi;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting an error while exporting data to an excel sheet. Code Response.Clear()
I am getting an error while trying to run CFmx code on a remote
I keep getting this error while trying to modify some tables. Here's my code:
I am using this php code: exec(unrar e file.rar,$ret,$code); and getting an error code
In a JSP file I'm getting a: Type expected (found 'try' instead) Error while
I'm making a post httpwebrequst, but in the HttpWebResponse im getting an error code
I am getting error trying to run my asp code for executing stored proc.
I wrote following code...but i am getting Error like: Error 1 'LoginDLL.Class1.Login(string, string, string)':
hi im new to c# and was trying to code but getting error can
With the following code, I keep getting error C2535 when I compile. It's complaining

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.