title: Transparent Activity with background activity click through behaviour in android
body: <p>Hi <code>stackoverflow</code> I'm trying to develop an application with a base activity and a <code>Transparent</code> activity, so far I'm able to create a <code>Activity</code> and a <code>Transparent</code> activity over base activity using follwing code</p>
  
  <p><code>MainActivity.java</code></p>
  
  <pre><code>public class MainActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      startActivity(new Intent(this, TransparentActivity.class));
  
      findViewById(R.id.button2).setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Toast.makeText(MainActivity.this, "Main", Toast.LENGTH_SHORT).show();
  
          }
      });
  }
  }
  </code></pre>
  
  <p><code>TransparentActivity.java</code></p>
  
  <pre><code>public class TransparentActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_transparent);
  
      findViewById(R.id.button1).setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Toast.makeText(TransparentActivity.this, "Btn1", Toast.LENGTH_SHORT).show();
          }
      });
  }
  }
  </code></pre>
  
  <p><code>styles.xml</code></p>
  
  <pre><code>&lt;resources&gt;
  &lt;style name="Theme.Transparent" parent="android:Theme"&gt;
      &lt;item name="android:windowIsTranslucent"&gt;true&lt;/item&gt;
      &lt;item name="android:windowBackground"&gt;@android:color/transparent&lt;/item&gt;
      &lt;item name="android:windowContentOverlay"&gt;@null&lt;/item&gt;
      &lt;item name="android:windowNoTitle"&gt;true&lt;/item&gt;
      &lt;item name="android:windowIsFloating"&gt;true&lt;/item&gt;
      &lt;item name="android:backgroundDimEnabled"&gt;false&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p></p>
  
  <p><code>Manifest</code></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.test"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="18" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name="com.example.test.MainActivity"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.example.test.TransparentActivity"
          android:theme="@style/Theme.Transparent" &gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p><code>activity_main.xml</code></p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context=".MainActivity" &gt;
  
  &lt;TextView
      android:id="@+id/textView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/hello_world" /&gt;
  
  &lt;Button
      android:id="@+id/button2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/textView1"
      android:layout_marginLeft="52dp"
      android:layout_toRightOf="@+id/textView1"
      android:text="Button" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><code>activity_transparent.xml</code></p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context=".MainActivity" &gt;
  
  &lt;Button
      android:id="@+id/button1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_alignParentRight="true"
      android:layout_marginBottom="29dp"
      android:layout_marginRight="44dp"
      android:text="Button" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>But I want the <code>Base Activity</code> to be touchable as well along with <code>TransparentActivity</code>. Please some one help me to solve this strange riddle.
  Thanks.</p>