Android Open Source - UnlockHumor Unlock Humor Service






From Project

Back to project page UnlockHumor.

License

The source code is released under:

Apache License

If you think the Android project UnlockHumor listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package cn.chendihao;
/*from   w ww.j  a va  2  s  .c o  m*/
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

public class UnlockHumorService extends Service {

  @Override
  public void onCreate() {
    super.onCreate();
  
    LayoutInflater inflater = LayoutInflater.from(UnlockHumorService.this);
        View view = inflater.inflate(R.layout.toast, null);
    
        Toast toast = new Toast(UnlockHumorService.this);
        toast.setView(view);
        toast.setDuration(Toast.LENGTH_LONG);
        toast.setGravity(Gravity.CENTER, 0, 0);
        
        toast.show();
        
        stopSelf();
  }

  @Override
  public void onDestroy() {

    super.onDestroy();
  }

  @Override
  public void onStart(Intent intent, int startId) {
    
    super.onStart(intent, startId);
  }

  @Override
  public IBinder onBind(Intent intent) {
    
    return null;
  }
}




Java Source Code List

cn.chendihao.AboutActivity.java
cn.chendihao.BootReceiver.java
cn.chendihao.ScreenOnReceiver.java
cn.chendihao.SettingActivity.java
cn.chendihao.UnlockHumorService.java