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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:33:10+00:00 2026-05-27T01:33:10+00:00

Possible Duplicate: SubMenu Layout Android Is there anyway to make the following submenu look

  • 0

Possible Duplicate:
SubMenu Layout Android

Is there anyway to make the following submenu look like the second (photoshopped) image?

Currently This is My Submenu:
enter image description here

Here Is the XML File For It:

<menu>
    <item android:id="@+id/facebook_icon"
        android:title="Share With Facebook"
        android:icon="@drawable/ic_menu_facebook" />

    <item android:id="@+id/twitter_icon"
        android:title="Share With Twitter"
        android:icon="@drawable/ic_menu_twitter" />         
</menu>

I want it to look like this (If you have any ideas I would appreciate hearing them!):
enter image description here

  • 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-27T01:33:10+00:00Added an answer on May 27, 2026 at 1:33 am

    Yes, it is possible. Try some thing like this:
    1. Create class to store your item types

    public final class AccountTypesProvider {
      public static List<AccountType> accountTypes = Collections.unmodifiableList(Arrays.asList(
          new AccountType(AccountType.TWITTER_ACCOUNT, "Twitter", R.drawable.ic_menu_twitter),
          new AccountType(AccountType.FACEBOOK_ACCOUNT, "Facebook", R.drawable.ic_menu_facebook)     
      ));
    }
    

    2.Create ListAdapter

    public final class AccountsTypesListAdapter extends ArrayAdapter<AccountType> {
      private Activity context;
      private List<AccountType> accountTypes;
      public AccountsTypesListAdapter(Activity context, List<AccountType> accountTypes) {
        super(context, R.layout.select_account_item, accountTypes);   
        this.context = context;
        this.accountTypes = accountTypes;
      }  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater = context.getLayoutInflater();
        View row = inflater.inflate(R.layout.select_account_item, parent, false);    
        TextView label = (TextView) row.findViewById(R.id.text_item);
        label.setText(accountTypes.get(position).title);    
        ImageView icon = (ImageView) row.findViewById(R.id.icon_item);
        icon.setImageResource(accountTypes.get(position).bigIconId);
        return row;
      }
    }
    

    3.Layout for your adapter:

    <?xml version="1.0" encoding="utf-8"?>   <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10px">      <ImageView android:id="@+id/icon_item"  android:layout_width="wrap_content" 
                     android:layout_height="fill_parent"/>
                     <TextView android:id="@+id/text_item" android:layout_width="wrap_content"
                       android:layout_height="fill_parent" android:paddingLeft="10px"
                       android:paddingTop="5px" android:textStyle="bold" 
                       android:textColor="#000000"/> 
            </LinearLayout>
    

    4.And your dialog

    public static void showSelectAccountTypeDialog(Activity context, String title, OnClickListener dialogListener) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle(title);
        builder.setAdapter(new AccountsTypesListAdapter(context, AccountTypesProvider.accountTypes), dialogListener);
        builder.create().show();
      }
    

    This code was taken from here

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

Sidebar

Related Questions

Possible Duplicate: Is there some ninja trick to make a variable constant after its
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: Singleton: How should it be used Following on from Ewan Makepeace 's
Possible Duplicate: git push error '[remote rejected] master -> master (branch is currently checked
Possible Duplicate: How to horizontally center a div? One simple way to make an
Possible Duplicate: How do I make a list with checkboxes in Java Swing? I
Possible Duplicate: how to use foursquare API in android application? This is a question
Possible Duplicate: Are there any O(1/n) algorithms? Any algorithm whose complexity decreases with increase
Possible Duplicate: Why do I see a double variable initialized to some value like
Possible Duplicate: Create Generic method constraining T to an Enum Is there any reason

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.