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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:34:42+00:00 2026-06-16T19:34:42+00:00

I want to divide layout for two parts in first I will have only

  • 0

I want to divide layout for two parts in first I will have only an analog clock, in the second I wanto to have a listview.

xml file ;

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


    <AnalogClock
        android:id="@+id/analogClock1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />


    <include
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        layout="@layout/day_plan" />

</LinearLayout>

xml of the including layout ;

    <?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
   android:id="@+id/countryTextView" 
   android:layout_width="fill_parent"
   android:layout_height="wrap_content" 
   android:padding="8dp"
   android:textSize="20sp" 
   android:textColor="@android:color/white"
   android:minHeight="?android:attr/listPreferredItemHeight"
   android:gravity="center_vertical"/>

I want to display under this clock a list with my events from database:

public class Clock extends ListActivity {

    public static final String ROW_ID = "row_id";
     private ListView conListView;
     private CursorAdapter conAdapter;
     public String opis;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.morning_clock);
        conListView=getListView();
        conListView.setOnItemClickListener(viewConListener);

        AnalogClock ac = (AnalogClock) findViewById(R.id.analogClock1);

        // map each name to a TextView
        String[] from = new String[] { "event" };
        int[] to = new int[] { R.id.countryTextView };
        conAdapter = new SimpleCursorAdapter(Clock.this, R.layout.morning_clock, null, from, to);
        setListAdapter(conAdapter); // set adapter

    }


        @Override
        protected void onResume() 
        {
           super.onResume();  
           new GetEvents().execute((Object[]) null);
         } 


        @Override
        protected void onStop() 
        {
           Cursor cursor = conAdapter.getCursor();

           if (cursor != null) 
              cursor.deactivate();

           conAdapter.changeCursor(null);
           super.onStop();
        }    


        private class GetEvents extends AsyncTask<Object, Object, Cursor> 
        {
           DatabaseConnector dbConnector = new DatabaseConnector(Clock.this);

           @Override
           protected Cursor doInBackground(Object... params)
           {
               Intent a = getIntent();
               String d_m_y = a.getStringExtra("d_m_y");
              dbConnector.open();
              return dbConnector.getdate(d_m_y); 
           } 

           @Override
           protected void onPostExecute(Cursor result)
           {
              conAdapter.changeCursor(result); // set the adapter's Cursor
              dbConnector.close();
           } 
        } 

        @Override
        public boolean onCreateOptionsMenu(Menu menu) 
        {
           super.onCreateOptionsMenu(menu);
           MenuInflater inflater = getMenuInflater();
           inflater.inflate(R.menu.dayplan_menu, menu);
           return true;
        }   

        @Override
        public boolean onOptionsItemSelected(MenuItem item) 
        {
           Intent addEvent = new Intent(Clock.this, AddEvent.class);
           startActivity(addEvent);
           return super.onOptionsItemSelected(item);
        }

        OnItemClickListener viewConListener = new OnItemClickListener() 
        {
           public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) 
           {         
              Intent viewEvent = new Intent(Clock.this, ViewEvent.class);
              viewEvent.putExtra(ROW_ID, arg3);

              startActivity(viewEvent);
           }
        };    

    }

and Im getting errors :

   01-02 21:57:50.645: E/AndroidRuntime(1047): FATAL EXCEPTION: main

01-02 21:57:50.645: E/AndroidRuntime(1047): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.examples.android.calendar/com.examples.android.calendar.Clock}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'

01-02 21:57:50.645: E/AndroidRuntime(1047):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)

01-02 21:57:50.645: E/AndroidRuntime(1047):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)

01-02 21:57:50.645: E/AndroidRuntime(1047):     at android.app.ActivityThread.access$600(ActivityThread.java:130)

01-02 21:57:50.645: E/AndroidRuntime(1047):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)

01-02 21:57:50.645: E/AndroidRuntime(1047):     at android.os.Handler.dispatchMessage(Handler.java:99)

01-02 21:57:50.645: E/AndroidRuntime(1047):     at android.os.Looper.loop(Looper.java:137)

01-02 21:57:50.645: E/AndroidRuntime(1047):     at android.app.ActivityThread.main(ActivityThread.java:4745)

01-02 21:57:50.645: E/AndroidRuntime(1047):     at java.lang.reflect.Method.invokeNative(Native Method)

01-02 21:57:50.645: E/AndroidRuntime(1047):     at java.lang.reflect.Method.invoke(Method.java:511)

01-02 21:57:50.645: E/AndroidRuntime(1047):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)

01-02 21:57:50.645: E/AndroidRuntime(1047):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)

01-02 21:57:50.645: E/AndroidRuntime(1047):     at dalvik.system.NativeStart.main(Native Method)
  • 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-16T19:34:43+00:00Added an answer on June 16, 2026 at 7:34 pm

    If you want to use a listactivity, the layout you are using must have a listview whose id is @android/list

    Check the doc here

    In the example you have

    <ListView android:id="@android:id/list"
               android:layout_width="match_parent"
               android:layout_height="match_parent"
               android:background="#00FF00"
               android:layout_weight="1"
               android:drawSelectorOnTop="false"/>
    

    So instead of your textview you really need to have a ListView with android:id="@android:id/list"

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

Sidebar

Related Questions

I want to divide the Google map display into 200 parts , I have
I want to divide my web application into two parts. One part is free,
I have two integers that I want to divide to get a percentage. This
I have a complex form to layout.Assume screen is equally divided into two parts
I want to divide a number of type double, by an int. I only
I want to divide the window into 2 parts. Each part I can draw
Here's a contrived example: I want to divide two numbers and I need to
I have 2 Ids #totalcbm and #gross , i want to divide both these
I have a large set of strings. I want to divide the strings into
I have a <div> , and in jQuery I want to divide this square

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.