-
-
Save verkaufer/985a7f4e0f145a729e0b to your computer and use it in GitHub Desktop.
Results activity that is launched from my main activity. This uses an adapter to load a listview.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dsgunter.randompokemongenerator; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.util.Log; | |
import android.widget.ListView; | |
import android.app.ListActivity; | |
import android.os.Bundle; | |
import android.widget.Toast; | |
import com.nostra13.universalimageloader.core.ImageLoader; | |
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: David | |
* Date: 7/10/13 | |
* Time: 6:12 PM | |
* <p/> | |
* (c) David Gunter 2013 unless otherwise noted | |
*/ | |
public class Results extends Activity { | |
//view variables | |
ListView list; | |
LazyAdapter adapter; | |
@Override | |
public void onCreate(Bundle savedInstanceState){ | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.list_generated_pokemon); | |
Intent i = getIntent(); | |
ArrayList<HashMap<String, String>> pokemonList = (ArrayList<HashMap<String,String>>) i.getSerializableExtra("pokemonList"); | |
//setup image loader | |
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()).build(); | |
ImageLoader.getInstance().init(config); | |
//send data to new adapter | |
MyAdapter adapter = new MyAdapter(this, pokemonList, R.layout.list_row, new String[]{}, new int[]{}); | |
//adapter = new LazyAdapter(Results.this, pokemonList); | |
list.setAdapter(adapter); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment