title: Android creating and returning value from dialogs called from non-Activity classes
body: <p>I've built an Android application which calls a TCP socket related thread from six different activities. It works just and fine, but as I try to add a simple dialog witch asks the user's id/pw just before starting the thread(the retrieved data will be required in the thread), I'm having trouble. There is an adapter class which is actually called to start the threads, but it is also not an "Activity" which can implement a dialog. </p>
  
  <p>Is there any way to solve this in some smarter method? Adding six same codes to create the dialog, and implementing additional six same handlers for each dialog will solve this, but I don't think that's not the right thing to do. </p>
  
  <p>I tried to make the dialog an Activity(with a dialog theme), but it can't return any datas since the class which starts this dialog like activity is not an Activity(thus, startActivityForResult is invalid). </p>
  
  <p>How can I solve this? Reforming the whole source is impossible, since it's over more than 20,000 line. Please help!</p>