thieumao

PaperActivity.java - Simple List View

Sep 4th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. package mao.demo.news;
  2.  
  3. import mao.demo.utils.Variables;
  4. import android.os.Bundle;
  5. import android.app.ListActivity;
  6. import android.view.Menu;
  7. import android.widget.ArrayAdapter;
  8.  
  9. public class PaperActivity extends ListActivity {
  10.  
  11.     @Override
  12.     protected void onCreate(Bundle savedInstanceState) {
  13.         super.onCreate(savedInstanceState);
  14.         // setContentView(R.layout.paper);
  15.         ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
  16.                 android.R.layout.simple_list_item_1, Variables.PAPERS);
  17.         setListAdapter(adapter);
  18.     }
  19.  
  20.     @Override
  21.     public boolean onCreateOptionsMenu(Menu menu) {
  22.         // Inflate the menu; this adds items to the action bar if it is present.
  23.         getMenuInflater().inflate(R.menu.paper, menu);
  24.         return true;
  25.     }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment