We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use this template as example
package com.yourpackage;
public class ScreenSaverActivity extends Activity {
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // use click or touch listener to finish this activity when user interact with this activity button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); setContentView("your layout"); } @Override protected void onResume() { super.onResume(); } @Override public void onStart() { super.onStart(); IntentFilter s = new IntentFilter(); s.addAction(Intent.ACTION_SCREEN_ON); s.addAction(Intent.ACTION_SCREEN_OFF); registerReceiver(mScreenTimeoutListener, new IntentFilter(s)); } @Override public void onStop() { unregisterReceiver(mScreenTimeoutListener); super.onStop(); } private BroadcastReceiver mScreenTimeoutListener = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) { finish(); } } }; @Override protected void onPause() { super.onPause(); }
}
The text was updated successfully, but these errors were encountered:
I want...lolcat saver,lol
Sorry, something went wrong.
TaichiN
No branches or pull requests
use this template as example
package com.yourpackage;
public class ScreenSaverActivity extends Activity {
}
The text was updated successfully, but these errors were encountered: