Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть How to create input box in android android dialog

  • Computer Science lectures and tutorials
  • 2016-08-03
  • 4236
How to create input box in android   android dialog
input box in androidandroid dialogtext input in dialog androidandroidprogramminginput
  • ok logo

Скачать How to create input box in android android dialog бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно How to create input box in android android dialog или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку How to create input box in android android dialog бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео How to create input box in android android dialog

How to create input box in android android dialog
Hi, we will see how to create a inputbox in
android. to create a inputbox, the steps of
creating the dialog is used. In addition to
that we have to add a textview to that.
first we will create a button, the onlclick
event of this button will create a inputbox.

We will now create a dialog.
Now lets create a edittext, so that users
will enter the data in this edittext.
now lets add this edittext to our dialog
the dialog contains 2 type of buttons
1) positivebutton
2) negative button

we will add a positive button first.
now the positive button's text is OK
when this button is clicked, we have to
get the text entered by user into the textview,
if negative button is clicked, lets display
no text entered.

the final step is to show the dialog.
lets check

please subscribe our channel to get more
videos.



package com.example.andtest;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class AndTest extends Activity {
Button but;
TextView txt;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_and_test);
but=(Button) findViewById(R.id.button1);
txt=(TextView) findViewById(R.id.textView1);
but.setOnClickListener(new OnClickListener()
{

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
AlertDialog.Builder ab=new AlertDialog.Builder(AndTest.this);
ab.setTitle("Enter any string");

final EditText et=new EditText(AndTest.this);

ab.setView(et);

ab.setPositiveButton("OK", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface arg0, int arg1) {
// TODO Auto-generated method stub
txt.setText(et.getText().toString());
}
});

ab.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface arg0, int arg1) {
// TODO Auto-generated method stub
txt.setText("No Text entered");
}
});

AlertDialog a=ab.create();
a.show();
}

}
);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_and_test, menu);
return true;
}

}

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]