If you’re using getApplicationContext()
as Context
in Activity for the dialog like this
Dialog dialog = new Dialog(getApplicationContext());
then use YourActivityName.this
Dialog dialog = new Dialog(YourActivityName.this);
More Related Contents:
- Android SQLite data display to ListView
- How to get IP address of the device from code?
- How to check a certain data already exists in firestore or not
- ViewPager and fragments — what’s the right way to store fragment’s state?
- Set style for TextView programmatically
- How do I find out which keystore was used to sign an app?
- How to get Resource Name from Resource id
- Android: Accessing assets folder sqlite database file with .sqlite extension
- Unresolved reference – activity does not recognize synthetic imports in android studio v4
- Backup and restore SQLite database to sdcard
- Disable / Check for Mock Location (prevent gps spoofing)
- Could not GET ‘play-services-location/maven-metadata.xml’. Received status code 502 from server: Bad Gateway
- ADB No Devices Found
- ExpandableListView – hide indicator for groups with no children
- gradle build fails on lint task
- How to parse this nested JSON array in android
- Does Android support JDK 6 or 7 [duplicate]
- How do you setLayoutParams() for an ImageView?
- MenuItem tinting on AppCompat Toolbar
- android Multiple selection ListView & Textview
- Android sdk cut/trim video file
- ANDROID : split the screen in 2 equals parts with 2 listviews
- How can I pass values between Activities on Android?
- Android Studio: how to attach Android SDK sources?
- onIabPurchaseFinished never called.
- Dynamically updating an AutoCompleteTextView adapter
- Change Device language via ADB
- VideoView onResume loses buffered portion of the video
- Copy text from TextView on Android
- Is there a way to get current process name in Android