title: Stack in android
body: <p>it's first time for me I use java
  I need to use a stack in android funcions
  but if I define the stack out of the function
  give me the error (should be parametrized) and the application crashes</p>
  
  <pre><code>public class Televideo extends Activity{
      Stack pila = new Stack();
  
      @Override
      public void onCreate(Bundle savedInstanceState){
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          pila.push(mystring);
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item){
          mystring = pila.peek();
      }
  }
  </code></pre>
  
  <p>how can I use the stack through class functions in java? thanks </p>