List of usage examples for android.widget ListView setAdapter
@Override public void setAdapter(ListAdapter adapter)
From source file:com.cleanwiz.applock.ui.adapter.MainPagerAdapter.java
@SuppressLint("InflateParams") private View buildBoxView() { boxAdapter = new BoxAdapter(mContext); View view = mInflater.inflate(R.layout.pager_safebox, null); ListView listView = (ListView) view.findViewById(R.id.lv_boxes); listView.setAdapter(boxAdapter); return view;/*from w ww . ja v a2 s .c o m*/ }
From source file:com.example.geronimo.sunshine.app.ForecastFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // The CursorAdapter will take data from our cursor and populate the ListView // However, we cannot use FLAG_AUTO_REQUERY since it is deprecated, so we will end // up with an empty list the first time we run. //Cursor cur = onCreateLoader(LOADER_ID,savedInstanceState); // mForecastAdapter = new ForecastAdapter(getActivity(), cur, 0); View rootView = inflater.inflate(R.layout.fragment_main, container, false); // Get a reference to the ListView, and attach this adapter to it. ListView listView = (ListView) rootView.findViewById(R.id.listview_forecast); listView.setAdapter(mForecastAdapter); return rootView; }
From source file:fr.simon.marquis.preferencesmanager.ui.RestoreDialogFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (getActivity() == null) { return null; }//from w w w. j av a2s . c o m View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_restore, null); assert view != null; ListView listView = (ListView) view.findViewById(R.id.listView); listView.setAdapter(new RestoreAdapter(getActivity(), this, backups, listener, mFullPath)); listView.setOnItemClickListener(this); return view; }
From source file:com.eyekabob.VenueInfo.java
protected void loadEvent(JSONObject response) { try {/* w w w . j ava 2s . c o m*/ JSONObject jsonResponse = response.getJSONObject("events"); JSONArray jsonEvents = jsonResponse.getJSONArray("event"); if (jsonEvents.length() > 0) { findViewById(R.id.venueInfoUpcomingHeader).setVisibility(View.VISIBLE); findViewById(R.id.venueInfoUpcomingEvents).setVisibility(View.VISIBLE); } eventsAdapter = new EventListAdapter(getApplicationContext()); for (int i = 0; i < jsonEvents.length() && i < 10; i++) { JSONObject jsonEvent = jsonEvents.getJSONObject(i); Event event = new Event(); event.setId(jsonEvent.getString("id")); event.setName(jsonEvent.getString("title")); event.setDate(EyekabobHelper.LastFM.toReadableDate(jsonEvent.getString("startDate"))); JSONObject jsonImage = EyekabobHelper.LastFM.getJSONImage("large", jsonEvent.getJSONArray("image")); event.addImageURL("large", jsonImage.getString("#text")); eventsAdapter.add(event); } } catch (JSONException e) { Log.e(getClass().getName(), "", e); } ListView eventsView = (ListView) findViewById(R.id.venueInfoUpcomingEvents); eventsView.setAdapter(eventsAdapter); eventsView.setOnItemClickListener(listItemListener); }
From source file:net.dahanne.android.google.client.GoogleActivity.java
private void showConnectOption() { String[] options = { "Connect" }; ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, options);/* w w w.j a v a2 s. c o m*/ ListView listView = (ListView) this.findViewById(R.id.google_activity_options_list); listView.setAdapter(arrayAdapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> parentView, View childView, int position, long id) { switch (position) { case 0: displayGoogleAuthorization(); break; default: break; } } }); }
From source file:com.eyekabob.CheckinSearchList.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.adlistactivity); VenueListAdapter adapter = new VenueListAdapter(getApplicationContext()); ListView lv = (ListView) findViewById(R.id.adList); lv.setOnItemClickListener(listItemListener); lv.setAdapter(adapter); Bundle extras = (Bundle) getIntent().getExtras(); Location location = null;//from w w w . j av a 2 s . c om if (extras != null) { location = (Location) extras.get("location"); } if (location == null) { location = EyekabobHelper.getLocation(this); } Map<String, String> params = new HashMap<String, String>(); params.put("ll", location.getLatitude() + "," + location.getLongitude()); params.put("radius", "3000"); // 3km seems like a reasonable checkin distance. String uri = EyekabobHelper.Foursquare.getUri("venues/search", params); new JSONRequestTask().execute(uri); }
From source file:com.fallahpoor.infocenter.fragments.SensorsFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_others, container, false); mIsApiAtLeast18 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2; mIsApiAtLeast19 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; ListView listView = (ListView) view.findViewById(R.id.listView); listView.setAdapter(new CustomArrayAdapter(getActivity(), getListItems())); return view;//from w w w.j a va 2 s.c o m }
From source file:com.myfuture.view.WelcomeFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View v = inflater.inflate(R.layout.track_welcome_layout, container, false); ((TextView) v.findViewById(R.id.greeting)) .setText(getString(R.string.welcome_message, ParseUser.getCurrentUser().getString("firstName"))); LinearLayout welcomeBlock = (LinearLayout) v.findViewById(R.id.welcome_color_block); int actionBarHeight = getActivity().getActionBar().getHeight(); welcomeBlock.setMinimumHeight(actionBarHeight + 270); wecomeDescriptionTextView = (TextView) v.findViewById(R.id.welcome_description); ListView list = (ListView) v.findViewById(R.id.welcome_details_list); list.setAdapter(adapter); return v;/* w w w .j a v a2 s .com*/ }
From source file:org.kepennar.android.client.social.twitter.TwitterActivity.java
private void showConnectOption() { String[] options = { "Connect" }; ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, options);//from ww w . ja va 2s . co m ListView listView = (ListView) this.findViewById(R.id.twitter_activity_options_list); listView.setAdapter(arrayAdapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> parentView, View childView, int position, long id) { switch (position) { case 0: displayTwitterAuthorization(); break; default: break; } } }); }
From source file:org.kepennar.android.client.social.facebook.FacebookActivity.java
private void showConnectOption() { String[] options = { "Connect" }; ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, options);/*from w w w. ja v a 2 s . com*/ ListView listView = (ListView) this.findViewById(R.id.facebook_activity_options_list); listView.setAdapter(arrayAdapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> parentView, View childView, int position, long id) { switch (position) { case 0: displayFacebookAuthorization(); break; default: break; } } }); }