Disabling the Touch of an Activity

Posted by Unknown Senin, 07 Januari 2013 0 komentar

On a button click we are creating the same class as a dialog so that the touch is not received


public class MainActivity extends Activity {
Dialog overlayDialog;
EditText edt;
Button bt;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

edt=(EditText)findViewById(R.id.editText1);
bt=(Button)findViewById(R.id.button1);
bt.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
disableAnyInput();
}
});
}
public void disableAnyInput(){
Toast.makeText(getApplicationContext(), "This will disable any input. Click the backbutton "
+ "to enable any input.", Toast.LENGTH_LONG).show();
overlayDialog = new Dialog(MainActivity.this,android.R.style.Theme_Panel);
overlayDialog.setCancelable(true);
overlayDialog.show();
} }
TERIMA KASIH ATAS KUNJUNGAN SAUDARA
Judul: Disabling the Touch of an Activity
Ditulis oleh Unknown
Rating Blog 5 dari 5
Semoga artikel ini bermanfaat bagi saudara. Jika ingin mengutip, baik itu sebagian atau keseluruhan dari isi artikel ini harap menyertakan link dofollow ke https://androidpopuler.blogspot.com/2013/01/disabling-touch-of-activity.html. Terima kasih sudah singgah membaca artikel ini.

0 komentar:

Posting Komentar

Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android populer.