thieumao

Simple List in Android

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