• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps R.layout.row cannot be solved

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:orientation="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...
 
Welcome to Android Forums! :)

Let me move this to the programmer's section for you. :)
 
next time , use the
Code:
 tag on the code to make it better oriented (and to avoid having emoticons appear in the middle of the code)

I think you should replace
                R.layout.row

with

R.layout.raw
 
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.
 
Back
Top Bottom