Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8932965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:25:31+00:00 2026-06-15T09:25:31+00:00

I follow next tutorial (first part of it), but with slightly simple class structure

  • 0

I follow next tutorial (first part of it), but with slightly simple class structure
http://www.learnopengles.com/how-to-use-opengl-es-2-in-an-android-live-wallpaper/

I get next chain of events when i try to select wallpaper (preview)

onCreateEngine()->onCreate() -> onResume()->onPause()->onResume()->onPause()
Why i get onResume()->onPause() two times?

When i hit “Set wallpaper” i get extra onPause()->onResume() and live wallpaper crashes (well maybe because onPause() called 2 times)

Also i don’t see calls of OGLES2Renderer like onSurfaceCreated(), onDrawFrame() in preview or on setting wallpaper.

What i missed out of view?

Android manifest (part of it)

<uses-feature
    android:name="android.software.live_wallpaper"
    android:required="true" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
<service
android:name="com.aristarhys.lw.LW"
android:label="@string/app_name"
android:permission="android.permission.BIND_WALLPAPER" >
<intent-filter>
    <action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data
    android:name="android.service.wallpaper"
    android:resource="@xml/lw" />

res/xml/lw.xml

<?xml version="1.0" encoding="UTF-8"?>
<wallpaper 
xmlns:android="http://schemas.android.com/apk/res/android"
android:thumbnail="@drawable/ic_launcher"
android:description="@string/app_desc"/>

LW.java

public class LW extends WallpaperService
{
public class OGLES2Engine extends Engine
{
    private class OGLES2SV extends GLSurfaceView 
    {
        public OGLES2SV(Context context)
        {
            super(context);
        }           

        public void onDestroy() 
        {
            super.onDetachedFromWindow();
        }
    }

    private OGLES2SV SV = null;

    @Override
    public void onCreate(SurfaceHolder surfaceHolder)
    {
        super.onCreate(surfaceHolder);
        SV = new OGLES2SV(LW.this);
        SV.setEGLContextClientVersion(2);
        SV.setRenderer(new OGLES2Renderer()); 
    }

    @Override
    public void onVisibilityChanged(boolean visible)
    {       

            if (!visible)
                SV.onResume();
            else
                SV.onPause();       
            super.onVisibilityChanged(visible);
    }

    @Override
    public void onDestroy()
    {
        SV.onDestroy();
        super.onDestroy();
    }
}

@Override
public Engine onCreateEngine()
{       
    return new OGLES2Engine();
}
}

OGLES2Renderer.java

public class OGLES2Renderer implements GLSurfaceView.Renderer
{
private static final String LOG_TAG = "GL2Surface";

@Override
public void onDrawFrame(GL10 unused) 
{
    Log.i(LOG_TAG, "Draw frame");
}

@Override
public void onSurfaceChanged(GL10 unused, int width, int height) 
{
    Log.i(LOG_TAG, "Surface changed");
}

@Override
public void onSurfaceCreated(GL10 unused_, EGLConfig _unused)
{
    Log.i(LOG_TAG, "Surface created");
}

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:25:32+00:00Added an answer on June 15, 2026 at 9:25 am

    You can use andengine Wallpaper extension to implement this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I follow this tutorial online exactly but somehow it's giving me errors. Saying there
I looked http://docs.djangoproject.com/en/dev/howto/static-files/ already, but am still confused on how to get css/image files
Trying this tutorial http://www.wpftutorial.net/ListBoxDataTemplate.html and thought of adding a radio button as follows <ListBox
I am trying to follow this tutorial: http://docs.jboss.org/richfaces/latest_3_3_X/en/cdkguide/html_single/ I am hitting a roadblock with
I read a tutorial in Django site but I don't understand how to use
I follow this tutorial for install omniauth in devise+mongoid: https://github.com/fertapric/rails3-mongoid-devise-omniauth/wiki/OmniAuth-Installation-Tutorial I have devise 1.4.5
I'm trying to follow the tutorial to use jQuery UI plugin. I'm new to
I am trying to follow along Michael Hartl's Rails tutorial but I've run across
Here we are again with the next problem in sorting. this is a follow
I am trying to follow this tutorial and I get the following error which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.