farhan678 / adwhirl

Automatically exported from code.google.com/p/adwhirl
0 stars 0 forks source link

Ads still requested when phone is locked #136

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If screen is locked due to inactivity or manual lock ads are still requested. - 
chub

Original issue reported on code.google.com by jpin...@google.com on 29 Oct 2010 at 6:26

GoogleCodeExporter commented 9 years ago
Issue 147 has been merged into this issue.

Original comment by wesgood...@google.com on 25 Nov 2010 at 12:31

GoogleCodeExporter commented 9 years ago
You can use the View.onWindowVisibilityChanged listener to get rid of this 
problem. 

    @Override
    protected void onStart() {
        super.onStart();
        if (adWhirlLayout != null) {
            adWhirlLayout.setVisibility(View.VISIBLE);
        }
    }

    @Override
    protected void onStop() {
        if (adWhirlLayout != null) {
            adWhirlLayout.setVisibility(View.INVISIBLE);
        }
        super.onStop();
    }

Maybe it's a good practise to implement public functions in AdWhirlLayout that 
trigger the listener directly. 

Cheers, 
Fabian 

Original comment by lueghau...@gmail.com on 9 May 2011 at 2:45

GoogleCodeExporter commented 9 years ago
does not work!
for example I am here testing with a Nexus ONE.
onStop is only called when I intent another activity, 
BUT ... when I click the LockScreen button.... onSTOP is 'NOT" called :(

Original comment by ilovesi...@gmail.com on 22 Jul 2011 at 7:37

GoogleCodeExporter commented 9 years ago
Shouldn't onPause be called if you lock the screen as you don't stop the 
application.
I don't see why onStop should be called if the application just pauses.

Original comment by michel.racic on 24 Jul 2011 at 2:09

GoogleCodeExporter commented 9 years ago
*yes onPause is triggered while ScreenLock"

but still Ads are rotated in the background.

My AdWhirl Layout is defined like that within a normal Layout:

--start
adlayout = (LinearLayout) findViewById(R.id.layout_ad); 
AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, AdWhirl_KEY); 
RelativeLayout.LayoutParams adWhirlLayoutParams = new 
RelativeLayout.LayoutParams(scaledWidth, scaledHeight);
adlayout.addView(adWhirlLayout, adWhirlLayoutParams); 
adlayout.invalidate();
--end

i tried:
--          adlayout.setVisibility(View.INVISIBLE);
does not change anything

I also made for test the adWhirlLayout global and 
---         adWhirlLayout.setVisibility(View.INVISIBLE);
even does not stop rotating.

so how to stop AdWhirl from rotating?

Original comment by ilovesi...@gmail.com on 29 Jul 2011 at 9:17

GoogleCodeExporter commented 9 years ago
AdWhirl team - any updates on this issue? We too are facing this problem and 
would like to know if you have a plan to fix it or not.

Thanks in advance.

Mayank

Original comment by apostek....@gmail.com on 24 Sep 2012 at 6:44