starting a new activity throws me into debug mode and stops the app


Last Updated:

  1. vaibhav5388

    vaibhav5388 New Member This Topic's Starter

    Joined:
    Jul 22, 2010
    Messages:
    1
    Likes Received:
    0
    I have a listview. Whenever I strike an item of listview the debugger gets opened instead of starting a new activity (i.e. what I want).

    here is the listview code..

    Code (Text):
    1. setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, s));
    2.         ListView lv = getListView();
    3.         lv.setTextFilterEnabled(true);
    4.         lv.setOnItemClickListener(new OnItemClickListener() {
    5.             public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
    6.                 startAc();
    7.     }
    8.   });
    the startAc() function is defined on top as:

    Code (Text):
    1. public void startAc()
    2.     {
    3.         startActivity( new Intent(this, contents.class) );
    4.     }
    the contents class file is defined as:

    Code (Text):
    1. package com.webkul.feedGrabber;
    2.  
    3. import android.app.ListActivity;
    4. import android.os.Bundle;
    5.  
    6. public class contents extends ListActivity{
    7.      @Override
    8.      protected void onCreate(Bundle savedInstanceState) {
    9.             super.onCreate(savedInstanceState);
    10.             setContentView(R.layout.m);
    11.      }
    12. }
    P.S. all the xml files are correct.
     

    Advertisement
  2. Boogs

    Boogs Well-Known Member

    Joined:
    Apr 6, 2010
    Messages:
    85
    Likes Received:
    16
    Is your Activity registered in your Android manifest XML file?
     
  3. James McMurray

    James McMurray Member

    Joined:
    May 5, 2009
    Messages:
    18
    Likes Received:
    0
    Check the logcat, it sounds like you're set to break on any exception and the call is throwing one.
     

Share This Page

Loading...