Advertisement
Guest User

Untitled

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