Problem about getting value from inner class in Android
<p>Hi I got something wrong in my code and I don't know why
My program have 2 spinner box and 1 textview.
when I choose something in both spinner it should call method from getrate inner class
which return some value to textview.
This getrate class working on my java app but it's don't working on android app.</p>

<p>here is my code</p>

<pre><code>public class BTS extends Activity {
/** Called when the activity is first created. */
 int i=0;
 int j=0;
 String[] li={"1","2","3"};
 getrate gr;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


 final Spinner combo = (Spinner)findViewById(R.id.widget30);
 final Spinner combo2 = (Spinner)findViewById(R.id.widget32);
 final TextView rate = (TextView) findViewById(R.id.widget31);


  ArrayAdapter&lt;String&gt; a = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item, li);
  ArrayAdapter&lt;String&gt; b = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item, li);
        combo.setAdapter(a);
        combo2.setAdapter(b);
        combo.setOnItemSelectedListener(new OnItemSelectedListener() {

   @Override
   public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,
     int arg2, long arg3) {
    // TODO Auto-generated method stub
    i = (int) combo.getSelectedItemId();
    if(i==0||j==0){rate.setText("กรุณาเลือกสถานีต้นทางและปลายทาง");}
    else {rate.setText("ราคาค่าโดยสาร : "+gr.get(i, j)+" บาท");}
   }

   @Override
   public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
    // TODO Auto-generated method stub

   }


  });


        combo2.setOnItemSelectedListener(new OnItemSelectedListener() {

   @Override
   public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,
     int arg2, long arg3) {
    // TODO Auto-generated method stub
    j = (int) combo2.getSelectedItemId();
    if(i==0||j==0){rate.setText("กรุณาเลือกสถานีต้นทางและปลายทาง");}
    else {rate.setText("ราคาค่าโดยสาร : "+gr.get(i, j)+" บาท");}
   }

   @Override



  public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
    // TODO Auto-generated method stub

   }
  });
    }
}




class getrate {

 private String[][] list;
 int c2=0;
 String[] ct={"1","2","3"};
 getrate(){

 }

 public String get(int i,int j){
  return ct[i];
 }

}
</code></pre>

<p>Ps. Sry for my english ;D</p>
