Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. import com.lee.pop.R;
  2.  
  3. import android.app.Activity;
  4. import android.app.Dialog;
  5. import android.content.Context;
  6. import android.os.Bundle;
  7. import android.widget.TextView;
  8.  
  9. public class pop extends Activity {
  10.     /** Called when the activity is first created. */
  11.     @Override
  12.     public void onCreate(Bundle savedInstanceState) {
  13.         super.onCreate(savedInstanceState);
  14.         setContentView(R.layout.main);
  15.  
  16.        
  17.            
  18.         Context mContext1 = getApplicationContext();
  19.         Dialog dialog1 = new Dialog(mContext1);
  20.        
  21.         dialog1.setContentView(R.layout.custom_dialog);
  22.         dialog1.setTitle("Custom Dialog");
  23.        
  24.         TextView text1 = (TextView) dialog1.findViewById(R.id.text);
  25.         text1.setText("Hello, this is a custom dialog!");
  26.         dialog1.show();
  27.        
  28.        
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement