I got the answer .. thanks @Gaurav Gupta .. the problem was i was not creating new object of LoginThread class every time in main Activity class
this is the modified code now of main Activity class
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
LoginThread login;
/**
* Reference to this activity
*/
login = new LoginThread(this);
/**
* login interface
*/
login.delegate=this;
login.execute();
}
i had mistakenly declared the object of LoginThread class globally