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

The Archive Base Latest Questions

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

I want to start another activity when the user clicks on the list item.

  • 0

I want to start another activity when the user clicks on the list item. When I run this, no error appears on the virtual machine but I am getting a totally blank screen. Any suggestions as to what mistake my code has ?

The activity code where I plan to start another activity is

public class Selector extends ListActivity {

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.selector);

    ListView listView = (ListView) findViewById(android.R.id.list);
     // storing string resources into Array
    String[] story_titles = getResources().getStringArray(R.array.story_list);

    // Binding resources Array to ListAdapter

    ArrayAdapter<String> adapter = new ArrayAdapter<String> (this,android.R.layout.simple_list_item_1,android.R.id.text1,story_titles);

    listView.setAdapter(adapter);
}


        public void onListItemClick(ListView parent,View view, int position, long id) {


            // Launching new Activity on selecting single List Item
            Intent i = new Intent(this, Descriptor.class);
            // sending data to new activity
            startActivity(i);
        }





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

}

The code for the Descriptor class is as follows

public class Descriptor extends ListActivity {

public void onCreateBundle(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.descriptor);
}

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

}

The descriptor xml is

<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/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="40dip"
    android:text="@string/select"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textColor="@android:color/background_dark" >
    </TextView>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >




<ListView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/list"
    android:layout_width="480dp"
    android:layout_height="wrap_content"
    android:padding="40dip"
    android:textSize="16dip"
    android:textStyle="bold" >

</ListView>


<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/textView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="40dip"
    android:text="@string/description"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textColor="@android:color/background_dark" >
    </TextView>

<TextView
    android:id="@+id/textView3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Story Description goes Here"
    android:padding="40dip"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textColor="@android:color/background_dark"
   />

</LinearLayout>
</LinearLayout>
</LinearLayout>

The manifest is

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.fableoid"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="15" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name=".Selector" />
    <activity android:name=".Descriptor" />
</application>

</manifest>
  • 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-15T04:20:05+00:00Added an answer on June 15, 2026 at 4:20 am

    You have a wrong method in your Descriptor.class.

    public void onCreateBundle(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    
        setContentView(R.layout.descriptor);
    }
    

    Call

    public void onCreate(Bundle savedInstanceState)
    

    instead

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

Sidebar

Related Questions

I want to start an activity when the user presses the space bar. My
To close the current activity and start another activity if the user does not
I have a situation like this: start(); <Some code> end(); I want start() function
I know how to pass data from one activity to another. But what I
Is there a way to start an activity from a view? I have this
I write a program support download file. When in this download activity, I start
i want to show a PD when my activity A starts another activity B.
I want to start several threads, retrive data from net, perform some actions with
I want to start a phar script as an executable, directly by doing foo.phar
I want to start manage application ( Settings -> Application -> manage application ->

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.