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
|
||||
|
||||

|
||||
|
||||
[](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…
x
Reference in New Issue
Block a user