I need a little help. I have lots of sampled but it doesn't work. Perhaps anyone can help me.
I have an activity class (Konsole) and an listActivity class (List5) and I'd like the list contain in the activity class.
Can anyone help me?
Using java Syntax Highlighting
- public class Konsole extends Activity {
- List5 liste = new List5();
- Button initialiseButton; Button startButton; Button stopButton; Button destroyButton;
- Button loadButton; Button refreshButton; Button uninstallButton; Button infoButton;
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
- //setContentView(R.layout.main);
- setContentView(R.layout.eingabefeld);
- //liste.msetListAdapter();
- initialiseButton = (Button)findViewById(R.id.get1);
- //initialiseButton.setOnClickListener(initialiseListener);
- initialiseButton.setEnabled(false);
- startButton = (Button)findViewById(R.id.get2);
- //startButton.setOnClickListener(startListener);
- startButton.setEnabled(false);
- .
- .
- .
- }
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
Using java Syntax Highlighting
- public class List5 extends ListActivity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setListAdapter(new MyListAdapter(this));
- }
- private class MyListAdapter extends BaseAdapter {
- public MyListAdapter(Context context) {
- mContext = context; }
- public int getCount() {
- return mStrings.length; }
- public boolean areAllItemsSelectable() {
- return false; }
- public boolean isSelectable(int position) {
- return !mStrings[position].startsWith("-"); }
- public Object getItem(int position) {
- return position; }
- public long getItemId(int position) {
- return position; }
- public View getView(int position, View convertView, ViewGroup parent) {
- TextView tv;
- if (convertView == null) {
- tv = new TextView(mContext);
- } else {
- tv = (TextView) convertView;
- }
- tv.setText(mStrings[position]);
- return tv;
- }
- private Context mContext;
- }
- private String[] mStrings = {
- "----------",
- "----------",
- "Abbaye de Belloc",
- "Abbaye du Mont des Cats",
- "Abertam",
- "----------",
- .
- .
- .
- };
- }
Parsed in 0.036 seconds, using GeSHi 1.0.8.4


