R.java is not generated or variable cannot be resolved
ive got XML player_layout.xml with code like below:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingTop="30dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView
android:id="@id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:entries="@strings/sections" >
</ListView>
</RelativeLayout>
now when im trying to build my project, im using this layout here:
public class PlayerListViewActivity extends Activity implements
OnItemClickListener {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.player_layout);
//* *EDIT* *
ListView listview = (ListView) findViewById(R.id.listView1);
listview.setOnItemClickListener(this);
}
public void onItemClick(AdapterView<?> l, View v, int position, long id) {
Log.i("HelloListView", "You clicked Item: " + id + " at position:" +
position);
}
}
when im trying to build my project, R.java file is not generating or when
i clean project variables R.layout.player_layout and R.id.listView1
"cannot be resolved etc"
in my opinion thats means there is an error in player_layout.xml, but i
cant figure out where
thanks in advance for help
No comments:
Post a Comment