1 |
package dk.thoerup.side9; |
package dk.thoerup.side9; |
2 |
|
|
3 |
|
import dk.thoerup.checkupdates.CheckUpdates; |
4 |
import android.app.Activity; |
import android.app.Activity; |
5 |
import android.content.Intent; |
import android.content.Intent; |
6 |
import android.net.Uri; |
import android.net.Uri; |
7 |
import android.os.Bundle; |
import android.os.Bundle; |
|
import android.util.Log; |
|
8 |
import android.view.View; |
import android.view.View; |
9 |
import android.widget.AdapterView; |
import android.widget.AdapterView; |
10 |
import android.widget.GridView; |
import android.widget.GridView; |
27 |
gridview.setOnItemClickListener(new OnItemClickListener() { |
gridview.setOnItemClickListener(new OnItemClickListener() { |
28 |
public void onItemClick(AdapterView<?> parent, View v, int position, long id) { |
public void onItemClick(AdapterView<?> parent, View v, int position, long id) { |
29 |
String uri = "file://" + images.getImagePath(position); |
String uri = "file://" + images.getImagePath(position); |
|
Log.i("VIEW", "URI=" + uri); |
|
30 |
|
|
31 |
Intent i = new Intent(Intent.ACTION_VIEW); |
//Intent i = new Intent(Intent.ACTION_VIEW); |
32 |
i.setDataAndType(Uri.parse(uri), "image/png"); |
//i.setDataAndType(Uri.parse(uri), "image/jpeg"); |
|
|
|
33 |
|
|
34 |
Log.i("VIEW", "" + position + " : " + images.getImagePath(position) + " : " + i.getAction() + " / " + i.getData()); |
Intent i = new Intent(PictureOverview.this, dk.thoerup.side9.PictureView.class); |
35 |
|
i.putExtra("files", images.getImagePaths()); |
36 |
|
i.putExtra("index", position); |
37 |
|
|
38 |
startActivity(i); |
startActivity(i); |
39 |
} |
} |
40 |
}); |
}); |
41 |
|
|
42 |
|
CheckUpdates update = new CheckUpdates(); |
43 |
|
update.checkForUpdates(this, "http://t-hoerup.dk/android/side9/version.txt", "Side 9 Pigen", "http://t-hoerup.dk/android/side9/Side9.apk"); |
44 |
|
|
45 |
} |
} |
46 |
} |
} |