I want to Show a popup window from main activity class on Click of a button 
and popup window contains a form and a submit button...now the problem is 
that when i click on that submit button form data is not pass to async 
class...



login =(Button)findViewById(R.id.login);
 login.setOnClickListener(new View.OnClickListener()
        {
        public void onClick(View v) 
        {  
       
        LayoutInflater layoutInflater 
     = (LayoutInflater)getBaseContext()
      .getSystemService(LAYOUT_INFLATER_SERVICE);  
    View popupView1 = layoutInflater.inflate(R.layout.login, null);  
      popupWindow1 = new PopupWindow(
               popupView1, 
               LayoutParams.WRAP_CONTENT,  
                     LayoutParams.WRAP_CONTENT,true);
            
          u=(EditText)popupView1.findViewById(R.id.username);
           
             u1=(EditText)popupView1.findViewById(R.id.pass);
           
            
             
             Button btnDismiss1 = 
(Button)popupView1.findViewById(R.id.login1);
            
             btnDismiss1.setOnClickListener(new Button.OnClickListener(){

     public void onClick(View v) {
      // TODO Auto-generated method stub
     uname=u.getText().toString();
     password=u1.getText().toString();
     lol(uname,password);
     //Toast.makeText(HomeActivity.this, uname+","+password, 
Toast.LENGTH_LONG).show();
     
      popupWindow1.dismiss();

      (new login()).execute(uname,password);////////*Not workin this line*


     }});
             popupWindow1.setHeight(500);
             popupWindow1.setWidth(500);
             popupWindow1.setFocusable(true);
             
             
             popupWindow1.showAtLocation(v, Gravity.CENTER, 0, 0);
         
      
        
        } });
 


 public class login extends AsyncTask<String, Object, Object> {
          
   
 protected String doInBackground(String... args) { 
       uname1= args[0];
      password1=args[1];
  
 
return null;
}
 protected void onPostExecute(String objResult) {
    try  {  
 // Toast.makeText(a, uname+","+pass, Toast.LENGTH_LONG).show();
  Toast.makeText(HomeActivity.this,"hello", Toast.LENGTH_LONG).show();
/*  Toast.makeText(HomeActivity.this, "session created", 
Toast.LENGTH_LONG).show();  
  Intent intent = new Intent(HomeActivity.this, Welcomepage.class);
       
     startActivity(intent);
      */  
       
  }
  catch(Exception e){
  
 // Toast.makeText(HomeActivity.this, e.toString(), 
Toast.LENGTH_LONG).show();
    e.printStackTrace();
    }
}
      
      
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to