Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

i have got warning like in topic, i already googled that however adding description not fix my problem, R.java is not generating, i was trying to clean and rebuild and nothing... whats wrong is with my .xml file

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >

<ListView
    android:id="@+id/listViewPlayer"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_above="@+id/buttonPrev"
    android:layout_alignParentTop="true"
    android:layout_alignLeft="@+id/seekBar1"
    android:layout_centerHorizontal="true" />

<SeekBar
   android:id="@+id/seekBar1"
   android:layout_width="200dp"
   android:layout_height="wrap_content"
   android:layout_alignParentBottom="true"
   android:layout_marginBottom="16dp" />

<ImageButton
    android:id="@+id/buttonPrev"
    android:layout_width="60dp"
    android:layout_height="60dp"
    android:layout_above="@+id/seekBar1"
    android:layout_alignLeft="@+id/seekBar1"
    android:src="@drawable/rewind" />

<ImageButton
    android:id="@+id/buttonPlay"
    android:layout_width="60dp"
    android:layout_height="60dp"
    android:layout_above="@+id/seekBar1"
    android:layout_toRightOf="@+id/buttonPrev"
    android:src="@drawable/play" />

<ImageButton
    android:id="@+id/buttonForw"
    android:layout_width="60dp"
    android:layout_height="60dp"
    android:layout_above="@+id/seekBar1"
    android:layout_toRightOf="@+id/buttonPlay"
    android:src="@drawable/fast_forward" />

<ImageButton
    android:id="@+id/buttonShuffle"
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:layout_above="@+id/seekBarVolume"
    android:layout_alignLeft="@+id/seekBarVolume"
    android:src="@drawable/shuffle" />

 <ImageButton
    android:id="@+id/buttonRepeat"
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:layout_above="@+id/seekBarVolume"
    android:layout_alignRight="@+id/seekBarVolume"
    android:src="@drawable/repeat" />

<SeekBar
    android:id="@+id/seekBarVolume"
    android:layout_width="100dp"
    android:layout_height="wrap_content"
    android:layout_toRightOf="@+id/seekBar1"
    android:layout_alignParentBottom="true"
    android:layout_marginBottom="16dp" />


</RelativeLayout>
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

R.java is not generating because of some error. It might be in the file also. one thing that I can suggest is that you need to use @+id/.. only when you are defining it first time. So for example you have already defined Seekbar in ListView liek:

<ListView
    ...
    android:layout_above="@+id/buttonPrev"
    >

So now you don't need to use + again for same ID. For rest of the place you can remove the + in front of ID's

<SeekBar
   android:id="@id/seekBar1"

Similar patter follows for other ID's.

share|improve this answer
    
problem disapears when i replace src with background and ImageButton with Button but i rly need ImageButtons –  fa1thly Aug 18 '13 at 12:13
    
what happens if you just change src with background without changing it to Button? –  Shobhit Puri Aug 18 '13 at 14:16
    
i fallowed your advices, i have deleted all not necessary +, clean project, restart eclipce and it works now, still dont know what was a reason, maybe that + –  fa1thly Aug 19 '13 at 12:17
    
Maybe that was the case or not. If you read the documentation on ID, it says ` The plus-symbol (+) means that this is a new resource name that must be created and added to our resources (in the R.java file). There are a number of other ID resources that are offered by the Android framework. When referencing an Android resource ID, you do not need the plus-symbol, but must add the android package namespace, like so`. –  Shobhit Puri Aug 19 '13 at 14:51
    
So It might be that R.java was not generated properly as each time + sign tell it to ad a new resource to R.java. But, you were just trying to reference the existing View instead of adding a new one. It might have been an issue. Nevertheless it works now. That's what's important ;) –  Shobhit Puri Aug 19 '13 at 14:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.