Skip to content Skip to sidebar Skip to footer

How Do I Launch The Preview/select Wallpaper Activity For My Wallpaper From Inside An Activity?

I think my question is fairly straight forward... how do I launch the standard activity for previewing my Live Wallpaper from within an Activity (of the same application)? *Edit: I

Solution 1:

Do you mean something like this?

  1. Make an activity that holds the Live Wallpaper fullscreen
  2. Open that activity using:

    Intent i = new Intent(this, [Activityname]); startActivity(i);

Solution 2:

Hahaha.. This answer is coming a little late. ;-) But, I don't think it's been answered correctly yet so here goes... What I gather is that you want to launch the wallpaper chooser. There's two ways to do that depending on which android version, you'll see below. You can only specify YOUR wallpaper after version 16. Otherwise, you launch the chooser and the user specifies the wallpaper.

if (android.os.Build.VERSION.SDK_INT >= 16)
    {
        Intentintent=newIntent("android.service.wallpaper.CHANGE_LIVE_WALLPAPER");
        intent.putExtra("android.service.wallpaper.extra.LIVE_WALLPAPER_COMPONENT", newComponentName(getApplicationContext().getPackageName(), (newStringBuilder(String.valueOf(getApplicationContext().getPackageName()))).append(".LiveWallpaper").toString()));


        try
        {
            startActivity(intent);
            finish();
            return;
        }
        catch (ActivityNotFoundException activitynotfoundexception)
        {
            activitynotfoundexception.printStackTrace();
        }
        return;
    }
    Intentintent1=newIntent();
    intent1.setAction("android.service.wallpaper.LIVE_WALLPAPER_CHOOSER");
    try
    {
        startActivity(intent1);
    }
    catch (ActivityNotFoundException activitynotfoundexception1)
    {
        activitynotfoundexception1.printStackTrace();
        Toast.makeText(getApplicationContext(), "Live Wallpapers not supported", 1).show();
    }
    finish();

Post a Comment for "How Do I Launch The Preview/select Wallpaper Activity For My Wallpaper From Inside An Activity?"