|
|
@@ -1,25 +1,13 @@ |
|
|
|
package at.ac.perg.htl.bhif16.coffeeapp; |
|
|
|
|
|
|
|
import android.content.Context; |
|
|
|
import android.database.sqlite.SQLiteDatabase; |
|
|
|
import android.graphics.Bitmap; |
|
|
|
import android.graphics.BitmapFactory; |
|
|
|
import android.os.AsyncTask; |
|
|
|
import android.content.Intent; |
|
|
|
import android.support.v7.app.AppCompatActivity; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.util.Log; |
|
|
|
import android.view.View; |
|
|
|
import android.widget.Button; |
|
|
|
import android.widget.ImageView; |
|
|
|
import android.widget.ListView; |
|
|
|
import android.widget.SimpleAdapter; |
|
|
|
import android.widget.TextView; |
|
|
|
import android.widget.Toast; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.net.MalformedURLException; |
|
|
|
import java.net.URL; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
@@ -28,14 +16,25 @@ public class MainActivity extends AppCompatActivity { |
|
|
|
|
|
|
|
|
|
|
|
// Array of strings for ListView Title |
|
|
|
String[] listviewTitle = new String[]{ |
|
|
|
"Achleitner", "Aichinger", "Bodingbauer", "Bogdan" |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
int[] listviewImage = new int[]{ |
|
|
|
R.drawable.achleitner, R.drawable.ic_launcher_background, R.drawable.ic_launcher_background, R.drawable.ic_launcher_background |
|
|
|
}; |
|
|
|
String[] listviewTitle = new String[]{ "Achleitner", "Aichinger", "Bodingbauer", |
|
|
|
"Bogdan","Derntl","Diesenreither", |
|
|
|
"Forthofer","Fröschl","Fürholzer", |
|
|
|
"Grünzweil","Gürler","Hametner", |
|
|
|
"Hemmelmayr","Kargl","Link", |
|
|
|
"Mayrhofer","Moser","Mühlbachler", |
|
|
|
"Nerat","Pilgersdorfer","Rauch", |
|
|
|
"Rauscher","Scheuchenpflug","Wall"}; |
|
|
|
|
|
|
|
int[] listviewImage = new int[]{ R.drawable.achleitner, R.drawable.aichinger, R.drawable.bodingbauer, |
|
|
|
R.drawable.bogdan, R.drawable.derntl, R.drawable.unknown, |
|
|
|
R.drawable.forthofer, R.drawable.froeschl, R.drawable.fuerholzer, |
|
|
|
R.drawable.unknown, R.drawable.unknown, R.drawable.hametner, |
|
|
|
R.drawable.hemmelmayr, R.drawable.kargl, R.drawable.link, |
|
|
|
R.drawable.mayrhofer, R.drawable.moser, R.drawable.muehlbacher, |
|
|
|
R.drawable.unknown, R.drawable.pilgersdorfer, R.drawable.rauch, |
|
|
|
R.drawable.rauscher, R.drawable.scheuchenpflug, R.drawable.wall}; |
|
|
|
|
|
|
|
TextView count_field; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@@ -43,9 +42,6 @@ public class MainActivity extends AppCompatActivity { |
|
|
|
super.onCreate(savedInstanceState); |
|
|
|
setContentView(R.layout.activity_main); |
|
|
|
|
|
|
|
Button countBtn = (Button) findViewById(R.id.count_btn); |
|
|
|
TextView count_field = (TextView) findViewById(R.id.count_field); |
|
|
|
|
|
|
|
List<HashMap<String, String>> aList = new ArrayList<HashMap<String, String>>(); |
|
|
|
for (int i = 0; i < listviewTitle.length; i++) { |
|
|
|
HashMap<String, String> hm = new HashMap<String, String>(); |
|
|
@@ -60,14 +56,16 @@ public class MainActivity extends AppCompatActivity { |
|
|
|
SimpleAdapter simpleAdapter = new SimpleAdapter(getBaseContext(), aList, R.layout.listview_activity, from, to); |
|
|
|
ListView androidListView = (ListView) findViewById(R.id.list_view); |
|
|
|
androidListView.setAdapter(simpleAdapter); |
|
|
|
countBtn.setOnClickListener(new View.OnClickListener() { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void onClick(View v) { |
|
|
|
Log.d("HURE","mog nimma"); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|