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

The Archive Base Latest Questions

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

I already have used MergeAdapter and works really well with ArrayAdapter, but when I

  • 0

I already have used MergeAdapter and works really well with ArrayAdapter, but when I used with LazyAdapter extends BaseAdapter, it doesn’t show any error on Logcat and the emulator don’t show nothing of the LazyAdapter content.

Question:

So is possible to work with BaseAdapter and MergeAdapter?
If not, its my code, what I should do?

ListFragment:

public class HomeFragment extends ListFragment{



    private static final String TAG = "URL";
    private MergeAdapter adapter = null;
    private ImageView [] imageView;
    private ViewFlipper flippy;
    private ArrayList<HashMap<String, String>> newsList = new ArrayList<HashMap<String, String>>();
    private NoticiaAdapter nAdapter = null;
    // XML node keys
        static final String KEY_SONG = "news"; // parent node
        static final String KEY_ID = "id";
        static final String KEY_TITLE = "title";
        static final String KEY_TEXT = "text";
        static final String KEY_HOUR = "hour";
        static final String KEY_THUMB_URL = "thumb_url";

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onViewCreated(view, savedInstanceState);

        setRetainInstance(true);

        String[] Url = create();
        new MyAsyncTask(Url).execute();
        nAdapter = new NoticiaAdapter(getActivity(), newsList);
        adapter = new MergeAdapter();
        adapter.addView(buildlabel1());
        adapter.addAdapter(nAdapter);

        setListAdapter(adapter);
        //mergeadapter
    }

LazyAdapter:

public class NoticiaAdapter extends BaseAdapter {   

    private FragmentActivity activity;
    private ArrayList<HashMap<String, String>> data;
    private static LayoutInflater inflater=null;
    public ImageLoader imageLoader; 
    ViewHolder holder = null;

    public final class ViewHolder {
        public TextView title;
        public TextView text;
        public TextView hour;
        public ImageView thumb_image;
        // public Button save_btn;

    }

     public NoticiaAdapter(FragmentActivity fragmentActivity, ArrayList<HashMap<String, String>> d) {
            super();
            this.activity = fragmentActivity;
            this.data = d;
            inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            imageLoader=new ImageLoader(activity.getApplicationContext());
        }

     public int getCount() {       
       return data.size();   
     }   


        public Object getItem(int position) {
            // TODO Auto-generated method stub
            return data.get(position);
        }


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

     @Override
        public void notifyDataSetChanged() {
            super.notifyDataSetChanged();
        }

     public View getView(int position, View convertView, ViewGroup parent) {  
         View vi=convertView;
            if(convertView==null) 

                vi = inflater.inflate(R.layout.news_list_row, null);
            holder = new ViewHolder();
            holder.title = (TextView)vi.findViewById(R.id.txtTitle); // title
            holder.text = (TextView)vi.findViewById(R.id.txtDescription); // artist name
            holder.hour = (TextView)vi.findViewById(R.id.txtHour); // duration
            holder.thumb_image=(ImageView)vi.findViewById(R.id.img_news); // thumb image

            HashMap<String, String> news = new HashMap<String, String>();
            news = data.get(position);

            holder.title.setText(news.get(HomeFragment.KEY_TITLE));
            holder.text.setText(news.get(HomeFragment.KEY_TEXT));
            holder.hour.setText(news.get(HomeFragment.KEY_HOUR));
            imageLoader.DisplayImage(news.get(HomeFragment.KEY_THUMB_URL), holder.thumb_image);

      return vi;   
     }

     public void add(HashMap<String, String> map) {
            // TODO Auto-generated method stub
            data.add(map);
            notifyDataSetChanged();

        }


    }
  • 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-17T09:14:35+00:00Added an answer on June 17, 2026 at 9:14 am

    Just to put an answer in this question, I have made a mistake, the xml file in my server was misspelled, So Yes MergeAdapter works with BaseAdapter.

    So this could be a sample code for who wants to use.

    Thanks Commonsware for your help.

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

Sidebar

Related Questions

sending mail along with embedded image using asp.net I have already used following but
I used to configure boost already, but this time I have no idea what
i have already used exception handling..... but it's don't give exception to me.. so
I already have used the Google CodePro AnalytiX but I never used Findbugs. My
I already have succesfully used MVVM principles in former projects, but i'm stuck with
i have already searched many places many people have used ABAddressBookRef class but my
I am building a login onto an completed app. The app have already used
I have used pexpect and sendline before, but this time I am running a
I have used jqGrid Treeview Adjacency model to display the hierarchy. Treeview works perfectly
I'm building a version of an App I have already released, but with a

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.