1. Check out our app, Forums for Android! Download and leave feedback here!

R.layout.row cannot be solved

Discussion in 'Application Development' started by Ravi Medar, Jul 29, 2010.

  1. Ravi Medar

    Ravi Medar New Member
    Thread Starter
    25

    Jul 29, 2010
    1
    0
    25
    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
    3,933

    Feb 19, 2010
    32,944
    25,329
    3,933
    Male
    Welcome to Android Forums! :)

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

    cp1 Well-Known Member
    53

    Apr 30, 2010
    375
    35
    53
    Do you have a row.xml file?
     
  4. JiMMaR

    JiMMaR Well-Known Member
    53

    Jun 12, 2010
    363
    57
    53
    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. 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
    5

    Nov 11, 2011
    1
    0
    5
    you need to have an xml file named row.xml under the layout folder for that to work
     

Share This Page

Loading...