title: How to show list of contents on buttons?
body: <p>I want to design an app in which there will be two buttons. And when we are pressing on each button one by one, it will show a list of some content.</p>
  
  <p>For this, I am using the following code:</p>
  
  <pre class="lang-java prettyprint-override"><code>this.findViewById( R.id.UpdateList ).setOnClickListener( this );
  this.findViewById( R.id.SettingsList ).setOnClickListener(buttonclicked); 
  </code></pre>
  
  <p>With this i am creating butttons. For on click, I am using:</p>
  
  <pre class="lang-java prettyprint-override"><code>ArrayList&lt;String&gt; smsList = new ArrayList&lt;String&gt;();
  public void onClick( View v ) {
      //My list content for first button
  }
  
  private OnClickListener buttonclicked = new OnClickListener() {
      public void onClick( View v ) {
          //My list content for second button
      }
      ListView settingsListView = (ListView) findViewById( R.id.SETTINGSList );
      settingsListView.setAdapter( new ArrayAdapter&lt;String&gt;( (Context) buttonclicked  , android.R.layout.simple_list_item_1, settingsList) );
  </code></pre>
  
  <p>but the problem is my first list is working fine but when the second button is pressed,it stopped forcefully.</p>
  
  <p><strong>EDIT</strong> logcat:</p>
  
  <pre><code>05-13 19:44:46.988: E/AndroidRuntime(6806): FATAL EXCEPTION: main 
  05-13 19:44:46.988: E/AndroidRuntime(6806): java.lang.ClassCastException: com.bitgriff.androidcalls.MainActivity$1 cannot be cast to android.content.Context 
  05-13 19:44:46.988: E/AndroidRuntime(6806):atcom.bitgriff.androidcalls.MainActivity$1.onClick(MainAc??tivity.java:506) 
  05-13 19:44:46.988: E/AndroidRuntime(6806):atandroid.view.View.performClick(View.java:3627) 
  05-13 19:44:46.988: E/AndroidRuntime(6806):atandroid.view.View$PerformClick.run(View.java:14329) –
  </code></pre>