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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:05:18+00:00 2026-06-14T10:05:18+00:00

I have some problem to use listview and SherlockActivity. my problem is that I

  • 0

I have some problem to use listview and SherlockActivity.
my problem is that I am getting null on this line:

ListView    lv = (ListView) findViewById(R.id.mainListView ); 

my xml looks like that:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/linearLa"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <ListView android:layout_width="fill_parent"   
      android:layout_height="fill_parent"   
      android:id="@+id/mainListView">  

    <ImageView
        android:id="@+id/iconremove"
        android:layout_width="50dip"
        android:layout_height="50dip"
        android:scaleType="centerCrop"
         android:src="@drawable/removeicon"
         android:visibility="gone"
          />

    <TextView
        android:id="@+id/textView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="left|center_vertical"
        android:layout_marginLeft="10dip"
        android:layout_weight="1"
        android:textSize="20dip" />
      </ListView>    
</LinearLayout>

and my code looks like that:

public class ListRss extends SherlockActivity  {
    ActionBar actionbar; 
    @SuppressWarnings("unchecked")
    public ArrayList<rssLinkAndTitle> ListRssLinkAndTitle=new ArrayList();
    //public ArrayList listValue=new ArrayList();
    RssArrays rssparser=new RssArrays();
    Context con;
    @SuppressWarnings("unchecked")
    @Override
    public void onCreate(Bundle savedInstanceState) {


            super.onCreate(savedInstanceState);

            actionbar=getSupportActionBar();
            con=getApplicationContext();
            ListRssAdpter listAdapter;
        //  ListView lv = getListView();

            ListView    lv = (ListView) findViewById(R.id.mainListView );

thanks for the help!

Updated:

added this

    super.onCreate(savedInstanceState);
           setContentView(R.layout.titlesrss);

and the errors are on this line ares:

11-17 07:57:46.341: E/AndroidRuntime(481): FATAL EXCEPTION: main
11-17 07:57:46.341: E/AndroidRuntime(481): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.rss/com.example.rss.ListRss}: java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.os.Handler.dispatchMessage(Handler.java:99)
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.os.Looper.loop(Looper.java:123)
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.app.ActivityThread.main(ActivityThread.java:3683)
11-17 07:57:46.341: E/AndroidRuntime(481):  at java.lang.reflect.Method.invokeNative(Native Method)
11-17 07:57:46.341: E/AndroidRuntime(481):  at java.lang.reflect.Method.invoke(Method.java:507)
11-17 07:57:46.341: E/AndroidRuntime(481):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-17 07:57:46.341: E/AndroidRuntime(481):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-17 07:57:46.341: E/AndroidRuntime(481):  at dalvik.system.NativeStart.main(Native Method)
11-17 07:57:46.341: E/AndroidRuntime(481): Caused by: java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.widget.AdapterView.addView(AdapterView.java:461)
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:627)
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
11-17 07:57:46.341: E/AndroidRuntime(481):  at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:853)
11-17 07:57:46.341: E/AndroidRuntime(481):  at com.actionbarsherlock.app.SherlockActivity.setContentView(SherlockActivity.java:229)
11-17 07:57:46.341: E/AndroidRuntime(481):  at com.example.rss.ListRss.onCreate(ListRss.java:54)
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-17 07:57:46.341: E/AndroidRuntime(481):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
11-17 07:57:46.341: E/AndroidRuntime(481):  ... 11 more
  • 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-14T10:05:19+00:00Added an answer on June 14, 2026 at 10:05 am

    I think you forgot to set your layout. So, after

                super.onCreate(savedInstanceState);
    

    add this

                setContentView(R.layout.nameOfXmlFileYouPostedWeDontKnowTheNameOf);
    

    where nameOfXmlFileYouPostedWeDontKnowTheNameOf is the name of the xml file

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

Sidebar

Related Questions

I have some problem with this mongoid. It's my first time to use mongoDB,
I have a list view with items that hold 2 views each(this ListView looks
I have some problem with MySQL Workbench in that I sometimes can't set foreign
I have some problems resizing a div with ID mask which I use to
i want to use .animate function but i have some problems i want to
I am just starting Java RMI and have some problems with when to use
I have some problem to get the utf-8 string from PHP using jQuery $.load()
I have some problem with the cursor when using JOprionPane. I set a cursor
I have some problem. Dialog.dismiss() does not work. I want to input ip, username,
I have some problem in my JDBC code. I am trying to connect through

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.