2014-03-24 09:48:19 -04:00
|
|
|
package com.example.hw4;
|
|
|
|
|
2014-03-24 10:02:07 -04:00
|
|
|
import android.os.AsyncTask;
|
2014-03-24 09:48:19 -04:00
|
|
|
import android.os.Bundle;
|
|
|
|
import android.app.Activity;
|
2014-03-24 10:02:07 -04:00
|
|
|
import android.graphics.Bitmap;
|
2014-03-24 09:48:19 -04:00
|
|
|
import android.view.Menu;
|
2014-03-24 10:02:07 -04:00
|
|
|
import android.view.View;
|
2014-03-24 09:48:19 -04:00
|
|
|
|
|
|
|
public class ImageViewerActivity extends Activity {
|
2014-03-24 10:02:07 -04:00
|
|
|
|
|
|
|
int urlsId;
|
|
|
|
String[] urls;
|
|
|
|
int currentIndex;
|
2014-03-24 09:48:19 -04:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
setContentView(R.layout.activity_image_viewer);
|
2014-03-24 10:02:07 -04:00
|
|
|
|
|
|
|
Bundle extras = getIntent().getExtras();
|
|
|
|
urlsId = extras.getInt("urls");
|
|
|
|
urls = getResources().getStringArray(urlsId);
|
|
|
|
currentIndex = extras.getInt("index");
|
2014-03-24 09:48:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onCreateOptionsMenu(Menu menu) {
|
|
|
|
// Inflate the menu; this adds items to the action bar if it is present.
|
|
|
|
getMenuInflater().inflate(R.menu.image_viewer, menu);
|
|
|
|
return true;
|
|
|
|
}
|
2014-03-24 10:02:07 -04:00
|
|
|
|
|
|
|
public void onClickPrev(View v) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onClickNext(View v) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onClickBack(View v) {
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void displayImage(int indexToDisplay) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private class ImageDownloader extends AsyncTask<String, Void, Bitmap> {
|
|
|
|
@Override
|
|
|
|
protected Bitmap doInBackground(String... params) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onPostExecute(Bitmap result) {
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
super.onPostExecute(result);
|
|
|
|
}
|
|
|
|
}
|
2014-03-24 09:48:19 -04:00
|
|
|
|
|
|
|
}
|