I am developing an Android app and after click of a button in home screen, I want to launch an activity which will be an overlay on the home screen. The activity launched should not be in full screen but must have some padding from all ends of the screen. How can i achieve this.
Asked
Active
Viewed 2,873 times
0
-
2Do some research before asking in this network. – Neo Jun 16 '16 at 07:15
-
There are ton of answer for that on web , just google it . – Zahidul Islam Jun 16 '16 at 07:17
-
Possible duplicate of [Android Activity as a dialog](http://stackoverflow.com/questions/1979369/android-activity-as-a-dialog) – Jonas Czech Jun 16 '16 at 09:50
3 Answers
0
Try Fragment Dialog. I think you want something like a Popup come when you are in home screen. Fragment dialog has its own life cycle. I didn't tried but I think this what you are searching.
https://developer.android.com/reference/android/app/DialogFragment.html

Avinash Verma
- 2,572
- 1
- 18
- 22
0
Try with these and next time spend a couple of minutes searching for it before ask anything.
How to show an Activity as pop-up on other Activity?
0
Set Your Activity Them Dialog
In Your manifest change your activity theme like this
<activity
android:name=".YOUR ACTIVITY NAME"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:theme="@style/Theme.AppCompat.Light.Dialog"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Vanraj Ghed
- 1,261
- 11
- 23