Back to project page Apocalypse-Defense.
The source code is released under:
MIT License
If you think the Android project Apocalypse-Defense listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.apocalypsedefense.app; /* w ww .j a v a2 s. co m*/ import android.app.Dialog; import android.content.Context; import android.os.Bundle; import android.util.Log; import android.view.MotionEvent; import android.view.View; public class InstructionsDialog extends Dialog { private static final String TAG = "InstructionsDialog"; public InstructionsDialog(Context context) { super(context, android.R.style.Theme_Translucent_NoTitleBar); } @Override public boolean onTouchEvent(MotionEvent event) { Log.d(TAG, "onTouchEvent"); // Close the dialog when it's touched // NOTE: It's also necessary to set every item in the XML file to not be Clickable this.dismiss(); return super.onTouchEvent(event); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.instructions_dialog); this.setCanceledOnTouchOutside(true); } }