Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.lee.pop.R;
- import android.app.Activity;
- import android.app.Dialog;
- import android.content.Context;
- import android.os.Bundle;
- import android.widget.TextView;
- public class pop extends Activity {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- setContentView(R.layout.custom_dialog);
- Context mContext1 = getApplicationContext();
- Dialog dialog1 = new Dialog(mContext1);
- dialog1.setContentView(R.layout.custom_dialog);
- dialog1.setTitle("Custom Dialog");
- TextView text1 = (TextView) dialog1.findViewById(R.id.text);
- text1.setText("Hello, this is a custom dialog!");
- dialog1.show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement