How To show Any View in box using Dialog - BD HELP ZONE
Hello guys, How are you all. Today i came to show you How to show AnyView in box using Dialog Component.
First of all, Create a component & set name ( i chose dialog).
2. In main.xml, put here Vertical linear layout & set it’s height and width as Match_Parent.
3. In linear layout, put here a Button.
4. Now go to the main_activity.java. Set button on click listener. Put here, Block
dialog.setTitle("Name");
dialog.setMessage("I Love You");
add an add source directly block. Copy this code and paste it into this block.
if you want to show webview text in dialog.
final WebView pb1= new Webview(MainActivity.this);
LinearLayout.LayoutParams lpa = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
pb1.setLayoutParams(lpa);
dialog.setView(pb1);
You can show there in any view. Just change its WebView and id
First of all, Create a component & set name ( i chose dialog).
2. In main.xml, put here Vertical linear layout & set it’s height and width as Match_Parent.
3. In linear layout, put here a Button.
4. Now go to the main_activity.java. Set button on click listener. Put here, Block
dialog.setTitle("Name");
dialog.setMessage("I Love You");
add an add source directly block. Copy this code and paste it into this block.
if you want to show webview text in dialog.
final WebView pb1= new Webview(MainActivity.this);
LinearLayout.LayoutParams lpa = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
pb1.setLayoutParams(lpa);
dialog.setView(pb1);
You can show there in any view. Just change its WebView and id
Comments
Post a Comment