1. Download our Official Android App: Forums for Android!

Apps R.layout.row cannot be solved

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

  1. Ravi Medar

    Ravi Medar Lurker
    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    1
    Joined:
    Jul 29, 2010

    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
    Rank:
     #4
    Points:
    3,933
    Posts:
    32,959
    Joined:
    Feb 19, 2010

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

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

    cp1 Android Enthusiast
    Rank:
    None
    Points:
    53
    Posts:
    375
    Joined:
    Apr 30, 2010

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

    JiMMaR Android Enthusiast
    Rank:
    None
    Points:
    53
    Posts:
    363
    Joined:
    Jun 12, 2010

    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. IanGClifton

    IanGClifton Well-Known Member
    Rank:
    None
    Points:
    58
    Posts:
    111
    Joined:
    Feb 7, 2010

    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 Lurker
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Nov 11, 2011

    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...