Fix no closing after setting wallpaper and add Play Store badge
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
aa71e50b74
commit
b67e739141
@ -1,5 +1,7 @@
|
||||
# Set as wallpaper
|
||||
|
||||
![<img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png" height="50"/>](https://play.google.com/store/apps/details?id=net.crystalyx.setaswallpaper)
|
||||
|
||||
[![Build Status](https://ci.crystalyx.net/api/badges/Xefir/SetAsWallpaper/status.svg)](https://ci.crystalyx.net/Xefir/SetAsWallpaper)
|
||||
|
||||
Provide a useful shortcut to set an image to your Android's wallpaper launcher and lock screen through the "Share" functionality.
|
||||
|
@ -17,10 +17,13 @@ import java.util.concurrent.Executors;
|
||||
|
||||
public class SetWallpaperActivity extends Activity {
|
||||
|
||||
private boolean toBeFinished;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
toBeFinished = false;
|
||||
Intent intent = getIntent();
|
||||
String type = intent.getType();
|
||||
|
||||
@ -29,7 +32,26 @@ public class SetWallpaperActivity extends Activity {
|
||||
handleUrl(intent.getStringExtra(Intent.EXTRA_TEXT));
|
||||
} else if (type.startsWith("image/")) {
|
||||
launchWallpaperActivity(intent.getParcelableExtra(Intent.EXTRA_STREAM), type);
|
||||
} else {
|
||||
toBeFinished = true;
|
||||
}
|
||||
} else {
|
||||
toBeFinished = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
toBeFinished = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if (!toBeFinished) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user