I want my activity to take smaller area of the screen e.g. toast doesn't cover all of the screen, it is just shown over other things and rest of the contents can be seen behind the toast. But it's a dialog, and I want my screen to be shown above other things e.g. above Home Screen. Below is the idea that is in my mind.
Kindly, guide me if it is even possible. If possible then show me the right path.
Thanks.
This example demonstrate about How to get full screen activity in android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.
Latest versions force a style based on Theme.AppCompat. Use this to create a quick dialog style based activity.
android:theme="@style/Theme.AppCompat.Dialog"
make your activity theme as translucent. add the following line in your manifest against that activity:
android:theme="@android:style/Theme.Translucent"
so that you can see the background things add the view to a LinearLayout with android:alignParentBottom=true
.
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