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

  • Home
  • SEARCH
  • 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 7503213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:08:34+00:00 2026-05-29T21:08:34+00:00

I have option menu on my activity. I am displaying another activity on click

  • 0

I have option menu on my activity. I am displaying another activity on click of options menu using below method:

@Override
public boolean onOptionsItemSelected(MenuItem item) {

    Intent intent = new Intent();

    switch (item.getItemId()) {

    case R.id.some_menu:
        intent.setComponent(new ComponentName(MyActivity.this,SomeActivity.class));
        startActivity(intent);
        return true;

    case R.id.someother_menu:
        intent.setComponent(new ComponentName(MyActivity.this, SomeOtherActivity.class));
        startActivity(intent);
        return true;

    default:
        return super.onOptionsItemSelected(item);
    }
}

First menu, some_menu, is working fine. It displays mentioned Activity. However, when I click second menu, someother_menu, it displays blank black screen. No idea what is happening.

XML for SomeOtherActivity:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<TextView
    android:id="@+id/follow"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textSize="25sp" 
    />

<ListView 
    android:id="@+id/follow_list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"> 
</ListView>
</LinearLayout>
  • 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-29T21:08:36+00:00Added an answer on May 29, 2026 at 9:08 pm

    Your layout is empty, so you will not see anything -> blank black screen.

    Add the text attribute to your TextView to show some dummy text:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
         android:layout_width="match_parent" android:layout_height="match_parent"   
         android:orientation="vertical" >
    
    <TextView
        android:id="@+id/follow"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="25sp" 
        android:text="DUMMYTEXT"
        />
    
    <ListView 
        android:id="@+id/follow_list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    </ListView>
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have ordinary activity with Option Menu, which I created by this code: @Override
I have these two options in the menu of an activity option one starts
I have created a horizontal menu with 5 tab options using a ul and
I have created an option menu for my app like this: var activity =
i have two Questions. 1) How to open option menu on click of checkbox
I have an options menu in an Activity with three MenuItems create select delete
Sharing an Options Menu between Activity and MapActivity. Is this possible? I have an
I have option menu widget: optionTuple = (filename1, filename2, filename3) filename1, filename2, filename3 are
I am developing android application in which i have to open option menu from
I have a html select list menu,when user select an option he/she is redirected

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.