i am using following code.
<RelativeLayout
android:layout_width="310dp"
android:layout_height="70dp"
android:layout_below="@+id/UIReportView"
android:layout_marginLeft="4dp"
android:layout_marginTop="2dp"
android:background="@drawable/small_corners" >
small_corners
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/UINoCorners"
android:shape="rectangle">
<corners android:radius="10dp"/>
<padding android:left="10dp"
android:right="10dp"
android:top="5dp"
android:bottom="5dp"/>
<solid android:color="#FFFFFF"/>
</shape>
Now , it shows a white bar. I want that, whenever i click on this relative layout its color should change, set by me.
report = (RelativeLayout) findViewById(R.id.UIMainReportViewTimely);
report .setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
// My Code
}
});
What should i do here? report.onTouchEvent?
And how can i change the color of background.
Best Regards
you can use this:-