Reputation: 4256
I am using an overlay view which covers most part of the screen. However I have received user reports saying that they were unable to push the INSTALL button of the Package Manager when installing third party APKs.
Is there any way to get rid of this problem? I thought something about using a BroadcastReceiver to catch ACTION_VIEW intents, but it seems not to be possible as this is an Activity action
I leave my class and xml layout file for reference:
public class OverlayView extends RelativeLayout{
private ImageView mImageView;
public OverlayView(ServiceOverlay overlayService) {
super(overlayService);
load();
mImageView = (ImageView) findViewById(R.id.backgroundimg);
}
public void destroy() {
final WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
wm.removeView(this);
}
private void load() {
LayoutInflater.from(getContext()).inflate(R.layout.overlay, this);
WindowManager.LayoutParams params = new WindowManager.LayoutParams(
WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
0x50728,
-3);
params.gravity = Gravity.CENTER;
((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)).addView(this, params);
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical"
android:paddingTop="0.0dip"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="0.0dip"
android:adjustViewBounds="false"
android:windowActionBarOverlay="true"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:id="@+id/backgroundimg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/bg2"
android:dither="false"
android:scaleType="fitXY"
android:windowActionBarOverlay="true" />
</LinearLayout>
Upvotes: 4
Views: 161
Reputation: 6884
Application installation is always in the user's control. That is how it was designed to be, and that is how it should be.
Imagine for example what would happen if the user wasn't in control of the apps being installed on the device. All kinds of spam apps would be installed and the user would lose control of the device. This may sometimes effect calls, messaging and overall efficiency of the device.
Therefore it is up to the user to remove this feature from the device Settings to be able to install third-party unsigned apps through the APK, as these have not been published to Google Play.
Upvotes: 1