Skip to content

Incompatibilities with older non-standard Android versions #1

Open

Description

@lars-olsson

The section of the MainActivity.java runs into problems on older versions of Android (allowed under API requirement 8 given in the manifest) for this section of code:

public void setClockLw(View v) {
Intent intent = new Intent(
WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
new ComponentName(this, ClockWallpaperService.class));
startActivity(intent);
}

This could be remedied by checking the version of Android, and disabling this if below API 16, or getting rid of this function altogether, and rely on the user enabling the live wallpaper from the standard way.

It might be somewhat discouraging if someone tries to follow this tutorial, runs on an older device, and finds it force closing on them.

Activity

  1. lars-olsson commented on Sep 24, 2014

    @lars-olsson
    Author

    Forgot to mention that the problem is due to the Intent WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER not being a requirement in Android prior to API 16.

  2. DkCloudAccount commented on Nov 20, 2017

    @DkCloudAccount

    Hey Dear lars-olsson This isa very nice Example of live wallpaper i want to create an App which set a Countdown-timer as a live wallpaper with various animations. i am just new in android Can you make this kind of tutorial or share any idea how can i get lead on this. Thanks In Advance :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions