Instanciation error when launching new activity from a dialog.
<p>I am facing instanciation error when I luanch new activity from a dialog. <br></p>

<p>I make a dialog object from main class then show a dialog. </p>

<pre><code>LoginDialog loginDialog = new LoginDialog(Main.this);
loginDialog.show(); 
</code></pre>

<p>Atfer dialog launched, dialog gets owner activity from dialog constructor.</p>

<pre><code>public LoginDialog(Activity activity) {
    // TODO Auto-generated constructor stub
    super(activity);
    mActivity = new Activity();
    mActivity = activity;
}
</code></pre>

<p>when user clicks a button from dialog, it should start a new activity <br>
but I gets an instanciate error instread.</p>

<pre><code>Button.OnClickListener loginTypeListener = new Button.OnClickListener(){

    public void onClick(View v){
        switch(v.getId()){

            case 1: 
                    if(!AutoLoginCheck.isChecked()){
                        AutoLoginChecked = false;
                    }
                    goToFbLogin();
    }

};     
void goToFbLogin(){
    Intent i = new Intent(mActivity, FacebookLogin.class);
    i.putExtra("CheckAutoLogin", AutoLoginChecked);
    mActivity.startActivity(i);
}
</code></pre>

<p>code looks fine to me but I am not sure why am I getting instanciate error.<br>
here is my logcat. 
<img src="http://i.stack.imgur.com/ExSIc.png" alt="enter image description here"></p>

<p>Can anybody tell me why am I getting instanciation error?</p>
