title: makeToast can't be resolved in another class
body: <p>I am trying to get the spinner value in another class from MainActivity via a method call. To check this, I am trying to Toast the input value that should be passed inside the second class. But I'm having an unusual problem for <code>makeToast()</code> method.</p>
  
  <p>I tried to change the parameter of <code>setSelectedMain()</code> with and without <code>Context context</code> both in the function call and function definitions, but still, the same error message appearing. Below is my <code>MainActivity.java</code> code:</p>
  
  <pre><code>package com.gazzali.spinitmeow;
  
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.text.TextUtils;
  import android.util.Log;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.ArrayAdapter;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.Spinner;
  import android.widget.TextView;
  
  public class MainActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener {
  
      Spinner spinnerMainChoice;
      Spinner spinnerInputChoice;
      Spinner spinnerOutputChoice;
  
      EditText getInputValueID;
      double inputValue;
  
      TextView outputValue;
  
      Button buttonConvert;
  
      String selectedMainChoice;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          /* ------------ Main code Starts Here ----------------*/
  
          /* Main conversion Type choice with Spinner (Drop Down menu)*/
          spinnerMainChoice = findViewById(R.id.spinnerIDMainChoice);
          // [IMPORTANT] Set Spinner Click Listener
          spinnerMainChoice.setOnItemSelectedListener(this);
          // Create an ArrayAdapter using the string array and a default spinner layout
          ArrayAdapter&lt;CharSequence&gt; adapterMainChoice = ArrayAdapter.createFromResource(this,
                  R.array.MainChoices_array, android.R.layout.simple_spinner_item);
          // Specify the layout to use when the list of choices appears
          adapterMainChoice.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
          // Apply the adapter to the spinner
          spinnerMainChoice.setAdapter(adapterMainChoice);
  
          /* Input Conversion type choice with Spinner */
          spinnerInputChoice = findViewById(R.id.spinnerIDInputChoice);
          spinnerInputChoice.setOnItemSelectedListener(this);
  
          /* Output Conversion type choice with Spinner */
  
          spinnerOutputChoice = findViewById(R.id.spinnerIDOutputChoice);
          spinnerOutputChoice.setOnItemSelectedListener(this);
  
          /* for input and output fields */
          getInputValueID = findViewById(R.id.editTextIDInputValue);
          String inputValueString = getInputValueID.getText().toString();
  
          /* only if InputValueString is not empty , then proceed */
          if(!TextUtils.isEmpty(inputValueString))
          {
              try
              {
                  inputValue = Double.parseDouble(inputValueString);
              }
              catch (Exception e1)
              {
                  e1.printStackTrace();
              }
          }
          outputValue = findViewById(R.id.textViewIDOutputValue);
  
      }
  
      @Override
      public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) {
          // An item was selected. retrieve the selected item
          selectedMainChoice = parent.getItemAtPosition(pos).toString();
          Log.i("Selected", selectedMainChoice);
          //Toast.makeText(MainActivity.this, "Selected: " + selectedMainChoice, Toast.LENGTH_SHORT).show();
  
              /* Implement object of spinnerSelects class*/
              spinnerSelects spinnerSelectsInMain = new spinnerSelects(spinnerInputChoice, spinnerOutputChoice);
              /* the main EVIL '(context) this' in  the 2nd parameter, 5 hours wasted, but I learnt many more */
              spinnerSelectsInMain.setInputOutputSpinners(selectedMainChoice, this);
  
              /* calling test for converter class */
          testOnConverter();
  
      }
  
      @Override
      public void onNothingSelected(AdapterView&lt;?&gt; parent) {
          // Another interface callback
      }
  
      public void testOnConverter(){
          converter converterInMain = new converter();
          converterInMain.setSelectedMain(this, selectedMainChoice);
      }
  
  }
  </code></pre>
  
  <p>Below is my <code>Converter.java</code> code :</p>
  
  <pre><code>package com.gazzali.spinitmeow;
  
  import android.content.Context;
  import android.util.Log;
  import android.widget.Spinner;
  import android.widget.Toast;
  
  public class converter {
      String selectedMainChoice;
      Spinner spinnerInputChoice, spinnerOutputChoice;
  
  
      public void setSelectedMain(Context context, String selectedMainChoiceFromMain) {
          this.selectedMainChoice = selectedMainChoiceFromMain;
  
          /* Here makeText() method shows error that it can't be Resolved */
  
          Toast.makeText(this, selectedMainChoice, Toast.LENGTH_SHORT).show();
      }
  
      public void setInputOutputChoice(Spinner spinnerInputChoiceFromSpinnerSelects, Spinner spinnerOutputChoiceFromSpinnerSelcts){
          this.spinnerInputChoice = spinnerInputChoiceFromSpinnerSelects;
          this.spinnerOutputChoice = spinnerOutputChoiceFromSpinnerSelcts;
  
      }
  }
  </code></pre>