Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. /* код фрагмента*/
  2. import android.os.Bundle;
  3. import android.support.v4.app.Fragment;
  4. import android.view.LayoutInflater;
  5. import android.view.View;
  6. import android.view.ViewGroup;
  7.  
  8.  
  9. /**
  10. * A simple {@link Fragment} subclass.
  11. */
  12. public class BlankFragmentTab1 extends Fragment {
  13.  
  14.  
  15. public BlankFragmentTab1() {
  16. // Required empty public constructor
  17. }
  18.  
  19.  
  20. @Override
  21. public View onCreateView(LayoutInflater inflater, ViewGroup container,
  22. Bundle savedInstanceState) {
  23. // Inflate the layout for this fragment
  24. return inflater.inflate(R.layout.fragment_blank_fragment_tab1, container, false);
  25. }
  26.  
  27. }
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. /*код кнопки */
  37.  
  38. ImageButton floatButton;
  39. EditText editText;
  40.  
  41.  
  42.  
  43.  
  44. floatButton = (ImageButton) findViewById(R.id.imageButton);
  45. floatButton.setOnClickListener(new View.OnClickListener(){
  46.  
  47. @Override
  48. public void onClick(View v) {
  49.  
  50. final AlertDialog.Builder mBuilder = new AlertDialog.Builder(Left.this);
  51. final View mView = getLayoutInflater().inflate(R.layout.create_project, null);
  52. editText = (EditText) mView.findViewById(R.id.etEmail);
  53. Button mLogin = (Button) mView.findViewById(R.id.btnLogin);
  54. mBuilder.setView(mView);
  55. final AlertDialog dialog = mBuilder.create();
  56. dialog.show();
  57.  
  58. mLogin.setOnClickListener(new View.OnClickListener() {
  59. @Override
  60. public void onClick(View view) {
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. dialog.dismiss();
  69.  
  70.  
  71. }
  72. });
  73. }
  74. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement