CopyPastor

Detecting plagiarism made easy.

Score: 1.8361379504203796; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2019-04-02
by Amit Desale

Original Post

Original - Posted on 2011-05-10
by Dinesh Sharma



            
Present in both answers; Present only in the new answer; Present only in the old answer;

See this and customize it according to your need.
public class ShowPopUp extends Activity { PopupWindow popUp; LinearLayout layout; TextView tv; LayoutParams params; LinearLayout mainLayout; Button but; boolean click = true; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); popUp = new PopupWindow(this); layout = new LinearLayout(this); mainLayout = new LinearLayout(this); tv = new TextView(this); but = new Button(this); but.setText("Click Me"); but.setOnClickListener(new OnClickListener() { public void onClick(View v) { if (click) { popUp.showAtLocation(layout, Gravity.BOTTOM, 10, 10); popUp.update(50, 50, 300, 80); click = false; } else { popUp.dismiss(); click = true; } } }); params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); layout.setOrientation(LinearLayout.VERTICAL); tv.setText("Hi this is a sample text for popup window"); layout.addView(tv, params); popUp.setContentView(layout); // popUp.showAtLocation(layout, Gravity.BOTTOM, 10, 10); mainLayout.addView(but, params); setContentView(mainLayout); } }
Hope this will solve your issue.

Here , I am giving you a demo example . See this and customize it according to your need.
public class ShowPopUp extends Activity { PopupWindow popUp; LinearLayout layout; TextView tv; LayoutParams params; LinearLayout mainLayout; Button but; boolean click = true; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); popUp = new PopupWindow(this); layout = new LinearLayout(this); mainLayout = new LinearLayout(this); tv = new TextView(this); but = new Button(this); but.setText("Click Me"); but.setOnClickListener(new OnClickListener() { public void onClick(View v) { if (click) { popUp.showAtLocation(layout, Gravity.BOTTOM, 10, 10); popUp.update(50, 50, 300, 80); click = false; } else { popUp.dismiss(); click = true; } } }); params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); layout.setOrientation(LinearLayout.VERTICAL); tv.setText("Hi this is a sample text for popup window"); layout.addView(tv, params); popUp.setContentView(layout); // popUp.showAtLocation(layout, Gravity.BOTTOM, 10, 10); mainLayout.addView(but, params); setContentView(mainLayout); } }
Hope this will solve your issue.


        
Present in both answers; Present only in the new answer; Present only in the old answer;