I'm trying to implement a daydream service with a transparent background.

I wrote the following code:

public void onAttachedToWindow() {
    super.onAttachedToWindow();
    setContentView(R.layout.mydream);
    getWindow().setBackgroundDrawable(new ColorDrawable(0));
    .
    .
    .
}


But when I start up the daydream, the background is only transparent for 1 second. After that it turns to black background.

Can anyone help me with this?


Question: Decompiler Bytecode and Obfuscators
Answer: 
  Can we completely reverse-engineer the source code from java bytecode ?


Not completely, because some aspects of source code, such as whitespace, local variable names, and comments, are not preserved in bytecode. Otherwise, yes -- while you can't get the exact same source code out, you can almost always get something that can at least be compiled back to the same bytecode.


  Why this feature is allowed in Java


It's not so much "allowed" as it is "not prevented". And it's not prevented because doing so is impossible -- the code must be runnable to be useful; if the code is runnable, then it is analyzable; if it is analyzable, then with sufficient analysis it can be converted back to source.


  How successful are java decompilers against obfuscators?


Not very. Most obfuscators I've seen (esp. ProGuard) are primarily effective in removing meaningful function and class names; obfuscating the logic itself is not typically attempted.