Popup window not showing

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Popup window not showing

Postby Zeba Momin » Fri Dec 04, 2009 1:24 pm

hello all..
I'm using the following code to show a popup Window.. n I'm using android sdk 1.5

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. private void showpopup() {
  2.  
  3.                 LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  4.  
  5.                 View v = vi.inflate(R.layout.pop, null);
  6.  
  7.                 PopupWindow Popup = new PopupWindow(v,0,0);
  8.  
  9.                                 Popup.setOutsideTouchable(false);
  10.  
  11.                 Popup.showAtLocation(this.findViewById(R.id.RelativeLayout01),Gravity.CENTER, 20, 20); 
  12.  
  13.         }
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


I hav called this function on d click of a menu option....
But dis doesn't seem to wrk..i dnt get any kind of popup window.
Can sumone plzzz.. help me wid dis... Thank you...
Zeba Momin
Developer
Developer
 
Posts: 49
Joined: Thu Sep 17, 2009 6:53 am

Top

Re: Popup window not showing

Postby Zeba Momin » Sat Dec 05, 2009 7:30 am

I solved dis problem by giving the popup window sum height n width.... !!!! :idea:



BTW..am I d only one who uses this forum???? :?:
Zeba Momin
Developer
Developer
 
Posts: 49
Joined: Thu Sep 17, 2009 6:53 am

Re: Popup window not showing

Postby chris123 » Wed Dec 16, 2009 4:04 am

try this:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. private void showpopup() {
  2.  
  3.                 LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  4.  
  5.                 View v = vi.inflate(R.layout.pop, null);
  6.  
  7.                 PopupWindow Popup = new PopupWindow(v,0,0);
  8.  
  9.                                 Popup.setOutsideTouchable(false);
  10.  
  11.                                 //设置PopupWindow的height和width
  12.  
  13.                                 Popup.update(50, 50, 20, 20);
  14.  
  15.                 Popup.showAtLocation(this.findViewById(R.id.RelativeLayout01),Gravity.CENTER, 20, 20); 
  16.  
  17.         }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
chris123
Freshman
Freshman
 
Posts: 3
Joined: Fri Nov 27, 2009 9:57 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Majestic-12 [Bot] and 3 guests