Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.adigroup;
- import android.app.Activity;
- import android.app.ListActivity;
- import android.content.Intent;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.AdapterView;
- import android.widget.ArrayAdapter;
- import android.widget.ListView;
- import android.widget.AdapterView.OnItemClickListener;
- public class ListViewDemo extends ListActivity {
- static final String[] title = new String[]
- {
- "Upcoming Events",
- "My Events ",
- "Speakers ",
- "Provider " ,
- "Messages "
- };
- ListView view;
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- view =(ListView)findViewById(android.R.id.list);
- setListAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1,title));
- getListView().setTextFilterEnabled(true);
- view.setOnItemClickListener(new OnItemClickListener() {
- //@Override
- public void onItemClick(AdapterView<?> a, View v, int position, long id ) {
- // for 1st
- Intent i = new Intent(ListViewDemo.this, LogScreen1.class);
- startActivity(i);
- // for 4th
- if(position==3)
- {
- Intent intent = new Intent(ListViewDemo.this, ProviderActivity.class);
- startActivity(intent);
- }
- // for 5th
- // else if(position==4)
- // {
- //
- // Intent intent = new Intent(ListViewDemo.this, MessageEventsActivity.class);
- // startActivity(intent);
- //
- //
- // }
- //
- // // for 3rd
- //
- // else if(position==2)
- // {
- //
- // Intent intent = new Intent(ListViewDemo.this, SpeakerParsingActivity.class);
- // startActivity(intent);
- //
- //
- // }
- // // for 2nd
- //
- // else if(position==1)
- // {
- //
- // Intent intent = new Intent(ListViewDemo.this, LogScreen1.class);
- // startActivity(intent);
- //
- //
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement