AlertDialog.Builder alert = new AlertDialog.Builder(this.getActivity()); alert.setTitle("Add New Supplier"); //Set an EditText view to get user input inputname = new EditText(Supplier.this.getActivity()); inputadd = new EditText(Supplier.this.getActivity()); inputtelp = new EditText(Supplier.this.getActivity()); inputname.setHint("Supplier's Name"); inputadd.setHint("Supplier's Address"); inputtelp.setHint("Supplier's Telp"); inputtelp.setInputType(InputType.TYPE_CLASS_NUMBER); LinearLayout lay = new LinearLayout(Supplier.this.getActivity()); lay.setOrientation(LinearLayout.VERTICAL); lay.addView(inputname); lay.addView(inputadd); lay.addView(inputtelp); alert.setView(lay); alert.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { new AddNewSupplier().execute(); } });
protected String doInBackground(String... arg0) { String namesupplier = inputname.getText().toString(); String addsupplier = inputadd.getText().toString(); String telpsupplier = inputtelp.getText().toString(); Toast.makeText(Supplier.this.getActivity(), namesupplier + "\n" + addsupplier + "\n" + telpsupplier, Toast.LENGTH_LONG).show();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)