發表文章

目前顯示的是有「交談視窗」標籤的文章

20170123 AlertDialog練習_在交談窗中加入按鈕

這個是AlertDialog練習 ,在交談窗中加入按鈕! 在這之中最多加入三個按鈕,否(Negative)中性(Neutral)及是(Positive) 加入的方法為setXxxButton() 而其中的Xxx分別為Negativity   Neutral    positive //AlertDialog練習在交談窗中加入按鈕 //20170124 劉彥廷  MainActivity.java package com.example.user.myapplication41; import android.content.DialogInterface; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; public class MainActivity extends AppCompatActivity implements DialogInterface.OnClickListener {     TextView txv;     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);         txv = (TextView)findViewById(R.id.answer);         new AlertDialog.Builder(this)             ...