R.layout.row cannot be solved


Last Updated:

  1. Ravi Medar

    Ravi Medar New Member This Topic's Starter

    Joined:
    Jul 29, 2010
    Messages:
    1
    Likes Received:
    0
    Hi,

    As i'm new to the android this is my activity class,public class test extends ListActivity {
    TextView selection;
    //AutoCompleteTextView edit;
    String[] items={"lorem", "ipsum", "dolor", "sit", "amet",
    "consectetuer", "adipiscing", "elit", "morbi", "vel",
    "ligula", "vitae", "arcu", "aliquet", "mollis",
    "etiam", "vel", "erat", "placerat", "ante",
    "porttitor", "sodales", "pellentesque", "augue", "purus"};
    @Override
    public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.main);
    setListAdapter(new ArrayAdapter<String>(this,
    R.layout.row, R.id.label,items));


    }
    }


    My main.xml will be
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:eek:rientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <ImageView
    android:id="@+id/icon"
    android:layout_width="22px"
    android:layout_height="wrap_content"
    android:paddingLeft="2px"
    android:paddingRight="2px"
    android:paddingTop="2px"
    android:paddingBottom="2px"
    android:src="@drawable/ok"
    />

    <TextView
    android:id="@+id/label"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textSize="44sp"

    />

    </LinearLayout>
    Its showing some error as R.layout.row cant be solved and error in image view
    pls help me out...
     

    Advertisement
  2. Steven58

    Steven58 Reformed PH VIP Member

    Joined:
    Feb 19, 2010
    Messages:
    32,920
    Likes Received:
    25,271
    Welcome to Android Forums! :)

    Let me move this to the programmer's section for you. :)
     
  3. cp1

    cp1 Well-Known Member

    Joined:
    Apr 30, 2010
    Messages:
    375
    Likes Received:
    35
    Do you have a row.xml file?
     
  4. JiMMaR

    JiMMaR Well-Known Member

    Joined:
    Jun 12, 2010
    Messages:
    363
    Likes Received:
    57
    next time , use the
    Code (Text):
    1.  tag on the code to make it better oriented (and to avoid having emoticons appear in the middle of the code)
    2.  
    3. I think you should replace
    4.                 R.layout.row
    5.  
    6. with
    7.  
    8. R.layout.raw
     
  5. IanGClifton

    IanGClifton Well-Known Member

    Joined:
    Feb 7, 2010
    Messages:
    111
    Likes Received:
    19
    Do you have a row.xml file? If that's what you meant by the main.xml file, check what errors it has. Any errors will cause that file to be a bad reference because it can't be added to the build.
     
  6. kumarji

    kumarji New Member

    Joined:
    Nov 11, 2011
    Messages:
    1
    Likes Received:
    0
    you need to have an xml file named row.xml under the layout folder for that to work
     

Share This Page

Loading...