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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:20:15+00:00 2026-06-13T08:20:15+00:00

I have a imageView in onCreate method where I am using method showList. This

  • 0

I have a imageView in onCreate method where I am using method showList. This is code:

action_bar_log_in_icon.setOnClickListener(new OnClickListener() {

                            @Override
                            public void onClick(View v) {

                                allResults.clear();
                                allResults.add(action_bar_log_in_icon);
                                allResults.add(action_bar_data_privacy_icon);
                                allResults.add(action_bar_vCard_icon);
                                allResults.add(action_bar_email_icon);
                                showList();
                            }
                        });

and code method showList:

private void showList() {
            final ListDialog listDialog = new ListDialog(this);
            listDialog.setCanceledOnTouchOutside(true);

            final ListView lv = (ListView) listDialog
                    .findViewById(R.id.spinnerlist);

            if(lAdapter == null){
                lAdapter = new ListAdapter(getBaseContext(),
                    R.layout.spinner_item,
                    (ArrayList<ImageView>) allResults);
            }

            lv.setAdapter(lAdapter);
            lv.setOnItemClickListener(new OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> parent, View view,
                        int position, long id) {
                    switch(position){
                    case 0:
                        intent = new Intent(ActionBarMain2.this, LoginActivity.class);
                        startActivity(intent);
                        break;
                    case 1:
                        intent = new Intent(ActionBarMain2.this, LoginActivity.class);
                        startActivity(intent);
                        break;
                    case 2:
                        intent = new Intent(ActionBarMain2.this, vCard_view.class);
                        startActivity(intent);
                        break;
                    case 3:
                        intent = new Intent(ActionBarMain2.this, EmailView.class);
                        startActivity(intent);
                        break;
                    }
                    listDialog.dismiss();
                }

            });
            WindowManager.LayoutParams WMLP = listDialog.getWindow()
                    .getAttributes();
            WMLP.gravity = Gravity.TOP | Gravity.RIGHT;
            WMLP.y = 50;
            WMLP.width = 100;
            listDialog.getWindow().setAttributes(WMLP);

                listDialog.show();



        }

This solution work and if I click on imageview my list is showing, but problem is when I click again on the same imageview. List is still visible. How I can do when I click first time my list is showing and when I click again my list dismiss etc?

  • 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-13T08:20:16+00:00Added an answer on June 13, 2026 at 8:20 am

    I find solution my problem. This dialog cover my imageView, so I placed dialog a little lower. Thank you for advices.

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

Sidebar

Related Questions

I have the following code in my onCreate-method: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
So i have this code: public class StreamingMp3Player extends Activity implements OnClickListener, OnTouchListener, OnCompletionListener,
onCreate() method: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.database); ListView lv=(ListView)findViewById(R.id.mylist); dbh = new
I have a LinearLayout and its child - ImageView. My activity's onCreate does nothing
I have imageView in activity. How I can set position this imageView in my
I have this ImageView in my layout: <ImageView android:layout_width=fill_parent android:layout_height=wrap_content android:contentDescription=@string/image_divider android:paddingBottom=8dp android:paddingTop=4dp android:scaleType=fitXY
I have modified the code in this question ,according to the answers there, in
I have this code but I am unable to find out how it is
I have an imageview that should be changed on click public class Settings extends
I am using this following code which creates a ListView with text and an

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.