I am developing some app in which in the launcher screen , if we check the radio button Vitan 

it should redirect to the login activity. 

In my MainActivity.java file , when i am creating the intent , it is showing some error . what is the reason for that ? 

In which cases we can use "this" for getting the context ? If not "this" what else we can use for getting the context ?



import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.RelativeLayout;
import android.view.View;
import android.widget.TextView;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.RadioButton;
import android.content.Intent;

public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        final RadioGroup radiogroup = (RadioGroup) findViewById(R.id.radiogroup);
        radiogroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {

       @Override
       public void onCheckedChanged(RadioGroup group, int checkedId)
       {
       RadioButton checkedRadioButton = (RadioButton) findViewById(checkedId);
        int comp = checkedRadioButton.getId();

       if(comp==(R.id.Vitbutton))
           Intent i = new Intent(this ,LoginActivity.class);
           startActivity(i);

                }
          }
        );
    }