title: Floating widgets/pop up window in android
body: <p>Im developing an app where a floating component should appear when the call is received and the component will have several buttons to perform necessary actions.
  I have tried the follow.
  I implemented a popup window by making the main activity translucent.when this component pops up, Im able to move it on the screen, but since the activity is translucent, im not able to perform any <img src="https://i.stack.imgur.com/qsMad.png" alt="enter image description here">other activity. </p>
  
  <p>here u can see the popup window, i can move it, but i cannot scroll the menudrawer in the background. How can i implement in such a way that i can perform both operations, i.e on popupwindow and the background screen.</p>
  
  <p>My codes</p>
  
  <pre><code>`public class MainActivity extends Activity {
      int mCurrentX;
      int mCurrentY;
       private float mDx;
       private float mDy;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
           final View cv = new View(this);
  
  
              TextView tv = new TextView(this);
              tv.setBackgroundColor(0xffeeeeee);
              tv.setTextColor(0xff000000);
              tv.setTextSize(24);
              tv.setText("click me\nthen drag me");
              tv.setPadding(8, 8, 8, 8);
            final PopupWindow  mPopup = new PopupWindow(tv, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
              OnTouchListener otl = new OnTouchListener() {
  
                  @Override
                  public boolean onTouch(View v, MotionEvent event) {
                      // TODO Auto-generated method stub
                      int action = event.getAction();
  
                      if (action == MotionEvent.ACTION_DOWN) {
                          mDx = mCurrentX - event.getRawX();
                          mDy = mCurrentY - event.getRawY();
                      } else
                      if (action == MotionEvent.ACTION_MOVE) {
                          mCurrentX = (int) (event.getRawX() + mDx);
                          mCurrentY = (int) (event.getRawY() + mDy);
                          mPopup.update(mCurrentX, mCurrentY, -1, -1);
  
                      }
                      return true;
                  }
              };
              tv.setOnTouchListener(otl);
  
              mCurrentX = 20;
              mCurrentY = 50;
  
              cv.post(new Runnable() {
                  @Override
                  public void run() {
                      mPopup.showAtLocation(cv, Gravity.NO_GRAVITY, mCurrentX, mCurrentY);
                  }
              });
      }
  
  }`
  </code></pre>
  
  <p>manifest</p>
  
  <pre><code>`&lt;application android:label="@string/app_name" android:icon="@drawable/ic_launcher"&gt;
  
          &lt;activity android:name=".MainActivity"
                    android:theme="@android:style/Theme.Translucent.NoTitleBar"
                    android:label="@string/app_name"
                    android:configChanges="orientation|screenSize"
                    android:windowSoftInputMode="adjustResize|stateAlwaysHidden"&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="PopupMainActivity"
                  android:label="@string/app_name"
                  android:theme="@style/Theme.FloatingWindow.Popup"
                  android:configChanges="orientation|screenSize"
                  android:windowSoftInputMode="adjustResize|stateAlwaysHidden"
                  android:clearTaskOnLaunch="true"
                  android:exported="true"
                  tools:ignore="ExportedActivity" /&gt;
  
      &lt;/application&gt;`
  </code></pre>
  
  <p>please help me on this. I want to implement a widget kind of component on the whole. Thanks!!</p>