title: change textview color on focus
body: <p>I have imageview, textview and other views inside my relative layout. Now my problem is textview color is not getting changed when it is focused. My layout is </p>
  
  <pre><code>&lt;RelativeLayout android:id="@+id/view"
   android:background="@drawable/bg1"
   android:focusable="true"
   android:clickable="true" 
  android:layout_width="wrap_content"
   android:layout_height="wrap_content" &gt;
   &lt;TextView 
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content" 
  android:text="@string/text" 
  android:textStyle="bold" 
  android:textSize="20dp"
   android:textColor="@color/selector" /&gt; 
  </code></pre>
  
  <p>i referred <a href="https://stackoverflow.com/questions/6360297/textview-color-change-on-focus-press">here</a> and added <code>android:duplicateParentState="true"</code> on my textview  but this solution is also not working for me.. help me in resolving this issue.. Thanks in advance..</p>
  
  <p>EDIT: If i use android:background am getting an error and my logcat is </p>
  
  <pre><code>    11-12 08:39:20.916: E/AndroidRuntime(4691): FATAL EXCEPTION: main
  11-12 08:39:20.916: E/AndroidRuntime(4691): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myview.myapp/com.myview.myapp.Mainclass}: android.view.InflateException: Binary XML file line #43: Error inflating class &lt;unknown&gt;
  11-12 08:39:20.916: E/AndroidRuntime(4691):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
  11-12 08:39:20.916: E/AndroidRuntime(4691):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  11-12 08:39:20.916: E/AndroidRuntime(4691):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
  11-12 08:39:20.916: E/AndroidRuntime(4691):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
  11-12 08:39:20.916: E/AndroidRuntime(4691):     at android.os.Handler.dispatchMessage(Handler.java:99)
  11-12 08:39:20.916: E/AndroidRuntime(4691):     at android.os.Looper.loop(Looper.java:137)
  11-12 08:39:20.916: E/AndroidRuntime(4691):     at android.app.ActivityThread.main(ActivityThread.java:4429)
  11-12 08:39:20.916: E/AndroidRuntime(4691):     at java.lang.reflect.Method.invokeNative(Native Method)
  11-12 08:39:20.916: E/AndroidRuntime(4691):     at java.lang.reflect.Method.invoke(Method.java:511)
  11-12 08:39:20.916: E/AndroidRuntime(4691):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
  11-12 08:39:20.916: E/AndroidRuntime(4691):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
  11-12 08:39:20.916: E/AndroidRuntime(4691):     at dalvik.system.NativeStart.main(Native Method)
  11-12 08:39:20.916: E/AndroidRuntime(4691): Caused by: android.view.InflateException: Binary XML file line #43: Error inflating class &lt;unknown&gt;
  </code></pre>
  
  <p>Here line 43 is starting of textview in xml</p>