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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:06:17+00:00 2026-06-12T05:06:17+00:00

I have written an android application to display a list. Code has taken from

  • 0

I have written an android application to display a list. Code has taken from an example. There is no error in compiling, but nothing is displayed on after running the application. Expecting you help to solve this problem thanks. Please find below code i used…

Main Activity

public class MainActivity extends ListActivity {
  ArrayList<String> listItems=new ArrayList<String>();
  ArrayAdapter<String> adapter;
  int clickCounter=0;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    listItems.add("Hello");

    adapter=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, listItems);
    setListAdapter(adapter);
  }

  public void addItems(View v) {
    listItems.add("Clicked : "+clickCounter++);
    adapter.notifyDataSetChanged();
  }
}

mainactivity.xml

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Button
    android:id="@+id/addBtn"
    android:text="Add New Item"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:onClick="addItems"/>
<ListView
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:drawSelectorOnTop="false"
/>

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.testlistview"
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" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="android.app.ListActivity" />
    </activity>
</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-12T05:06:19+00:00Added an answer on June 12, 2026 at 5:06 am

    Please add the following intentfilter to the manifest:

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

    Android needs this intent filter to know which activity to start.

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

Sidebar

Related Questions

I have written an Android application that I am about to release, but I
I have an android application (written in java) which has two buttons ( connect
In the Android application I have written, there is a portion which allows the
I have written an application for Android. the main part being that it communicates
I have written this code inside a servlet to delete certain records from three
I have written an Android application that uses SQLite database which is saved in
I'm just starting with android development and have written an application to show details
I have android application that is written regular way. layouts, java, APK. Now, depending
I have written a simple Android application that uses a sqlite database which is
I am developing an android application using google maps. I have to display some

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.