0

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:orientation="horizontal"  android:layout_width="fill_parent" android:layout_height="74.0dip"
     xmlns:android="http://schemas.android.com/apk/res/android">
     <io.vov.vitamio.widget.CenterLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">

         <io.vov.vitamio.widget.VideoView android:id="@id/surface_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_centerHorizontal="true" android:layout_centerVertical="true" />


     </io.vov.vitamio.widget.CenterLayout>


  </RelativeLayout>

mediaconroller.xml

<RelativeLayout android:orientation="horizontal" android:background="@drawable/mediacontroller_bg" android:layout_width="fill_parent" android:layout_height="74.0dip" android:layout_marginLeft="0.0dip" android:layout_marginRight="0.0dip" android:layout_marginBottom="0.0dip" android:layout_alignParentBottom="true"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <ImageButton android:gravity="center" android:id="@id/mediacontroller_play_pause" android:background="#00000000" android:layout_width="54.599976dip" android:layout_height="32.0dip" android:layout_marginRight="7.0dip" android:src="@drawable/mediacontroller_pause_button" android:layout_alignParentRight="true" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:contentDescription="@string/mediacontroller_play_pause" />
    <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="7.0dip" android:layout_marginTop="2.0dip" android:layout_marginRight="7.0dip" android:layout_marginBottom="2.0dip" android:layout_toLeftOf="@id/mediacontroller_play_pause">
        <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
            <TextView android:id="@id/mediacontroller_time_current" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" style="@style/MediaController_Text" />
            <TextView android:id="@id/mediacontroller_time_total" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentRight="true" style="@style/MediaController_Text" />
        </RelativeLayout>
        <SeekBar android:id="@id/mediacontroller_seekbar" android:focusable="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:max="1000" android:layout_centerVertical="true" style="@style/MediaController_SeekBar" />
        <TextView android:ellipsize="marquee" android:id="@id/mediacontroller_file_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:layout_alignParentBottom="true" style="@style/MediaController_Text" />
    </RelativeLayout>
</RelativeLayout>

I have four files in res/drawable folder which have following names

mediacontroller_pause_button.xml
mediacontroller_play_button.xml 
mediacontroller_seekbar_thumb.xml
mediacontroller_seekbar.xml

id is not updated automatically how can i update id ? i am new to android please help me to solve this error i got error in following two layout file mediacontroller.xml and activity_main.xml and error is

error: Error: No resource found that matches the given name (at 'id' with value '@id/ mediacontroller_time_current').

i am not using +id sign but the the thing is R.java is not automatically update it's id thats why i am not getting suggestion my question is how to get suggestion so my error is solved

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307

1 Answers1

1

You probably wanted to use android:id="@+id/surface_view" instead.

Basically, the "plus sign" indicates that you're defining a new id inline. If you don't add it, then you are instead adding a reference to an id, which must be preexisting.

For example, in android:layout_toLeftOf="@id/mediacontroller_play_pause" it's correct to omit the "+", because you're not defining that id in there.

matiash
  • 54,791
  • 16
  • 125
  • 154
  • i am not using + sign but the the thing is R.java is not automatically update it's id thats why i am not getting suggestion my question is how to get suggestion so my error is solved – Shyamal Patel Jul 13 '14 at 19:31
  • @user3578882 I'm not sure I understand what you're trying to do. To reference a drawable you must use `@drawable/name`, not `@id/name`. But you cannot make a drawable the _id_ of a TextView. – matiash Jul 13 '14 at 19:35