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

The Archive Base Latest Questions

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

Have quite a strange problem below is my menu activity_action_bar_main.xml and it complains on

  • 0

Have quite a strange problem

below is my menu activity_action_bar_main.xml and it complains on the

android:icon="@android:drawable/ic_action_view_as_list"

row

<menu xmlns:android="http://schemas.android.com/apk/res/android" 
    >

    <item
        android:id="@+id/menu_settings"
        android:orderInCategory="100"
        android:showAsAction="ifRoom|withText"
        android:title="Action Bar1"
        android:icon="@android:drawable/ic_action_view_as_list"/> 

</menu>

And it complains on my icon

[2012-11-15 02:38:53 - TabsimpleActionBar] W/ResourceType( 3908): Bad XML block: header size 789 or total size 0 is larger than data size 0
[2012-11-15 02:38:53 - TabsimpleActionBar] C:\Users\djzingo\workspace1\TabsimpleActionBar\res\menu\activity_action_bar_main.xml:4: error: Error: No resource found that matches the given name (at 'icon' with value '@android:drawable/ic_action_view_as_list').

But I use it elsewhere in my code and it shows up as it should so I now that it is in place.

package com.ahmad.actionBar;

import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.app.ActionBar.Tab;
import android.app.ActionBar.TabListener;
import android.app.Activity;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.Menu;
import android.widget.RelativeLayout;

@SuppressLint("NewApi")
public class ActionBarMain extends Activity implements TabListener {
    RelativeLayout rl;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_action_bar_main);
        try {
            rl = (RelativeLayout) findViewById(R.id.mainLayout);
            fragMentTra = getFragmentManager().beginTransaction();
            ActionBar bar = getActionBar();
            bar.addTab(bar.newTab()
                    .setText("Collection")
                    .setIcon(R.drawable.ic_action_view_as_list)//It works here
                    .setTabListener(this));;;

            bar.addTab(bar.newTab()
                        .setText("Summary")
                        .setIcon(R.drawable.ic_action_info)
                        .setTabListener(this));;;


            bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM
                    | ActionBar.DISPLAY_USE_LOGO);
            bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
            bar.setDisplayShowHomeEnabled(true);
            bar.setDisplayShowTitleEnabled(false);
            bar.show();

        } catch (Exception e) {
            e.getMessage();
        }

    }

    FragMent1 fram1;
    FragmentTransaction fragMentTra = null;
    FragMent2 fram2;
    FragMent3 fram3;



    public void onTabReselected(Tab tab, FragmentTransaction ft) {
    }

    public void onTabSelected(Tab tab, FragmentTransaction ft) {

        if (tab.getText().equals("Collection")) {
            try {
                rl.removeAllViews();
            } catch (Exception e) {
            }
            fram1 = new FragMent1();
            fragMentTra.addToBackStack(null);
            fragMentTra = getFragmentManager().beginTransaction();
            fragMentTra.add(rl.getId(), fram1);
            fragMentTra.commit();
        } else if (tab.getText().equals("Summary")) {
            try {
                rl.removeAllViews();
            } catch (Exception e) {
            }
            fram2 = new FragMent2();
            fragMentTra.addToBackStack(null);
            fragMentTra = getFragmentManager().beginTransaction();
            fragMentTra.add(rl.getId(), fram2);
            fragMentTra.commit();
        } else if (tab.getText().equals("Details")) {
            try {
                rl.removeAllViews();
            } catch (Exception e) {
            }
            fram3 = new FragMent3();
            fragMentTra.addToBackStack(null);
            fragMentTra = getFragmentManager().beginTransaction();
            fragMentTra.add(rl.getId(), fram3);
            fragMentTra.commit();
        }

    }

    public void onTabUnselected(Tab tab, FragmentTransaction ft) {

    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_action_bar_main, menu);
        return true;
    }

}

You have any suggestions why it works when I remove the android:icon=”@android:drawable/ic_action_view_as_list” line but get BadXML block when I add the icon to the xml file?

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

    I think this drawable is not part of the android drawable, so try

    android:icon="@drawable/ic_action_view_as_list"
    

    instead.

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

Sidebar

Related Questions

I have quite a strange problem with PHP and Apache on my local testing
I have a strange problem that I can't seem to solve. I've quite a
This is a quite strange problem. I have set a setting variable in Application
I have a quite strange problem: I am testing several function calls to a
Hallo, I have a quite strange problem in one of my C++ projects: I
I have got an strange problem but I am quite sure, for you it
I have quite a strange problem , While copying one WidgetCollection from one FlowPanel
Well, my problem is quite strange, because it really doesn't make sense. 1)I have
i have a quite strange problem. my class has -among others- following memers: GLboolean
I have a strange problem using Generics in Java. Generics are quite new to

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.