I have an Activity A, and there is a button B in the view. If somebody presses B then I want a pop-up which can take some part of screen making the A invisible in that area but rest of A is visible but not active. How can I achieve this?
If you want to do this using an Activity instead of a Dialog, you can do this by setting the activity's theme to android:theme="@android:style/Theme. Dialog" in the manifest - this will make the activity appear like a dialog (floating on top of whatever was underneath it).
If you want to finish you activity then you can simply send a broadcast from your activity B to activity A. Intent intent = new Intent("finish_activity"); sendBroadcast(intent);
If you want to do this using an Activity instead of a Dialog, you can do this by setting the activity's theme to android:theme="@android:style/Theme.Dialog"
in the manifest - this will make the activity appear like a dialog (floating on top of whatever was underneath it).
For AppCompat, add
android:theme="@style/Theme.AppCompat.Dialog.Alert"
to the activity in AndroidManifest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With