1
0
mirror of https://github.com/bspeice/itcs4180 synced 2024-11-12 18:38:24 -05:00

Buttons now launch the correct activities

Only thing left to do is the photo activities themselves.
This commit is contained in:
DjBushido 2014-02-28 20:34:01 -05:00
parent 53b7016846
commit ecb13bc4ed
2 changed files with 12 additions and 0 deletions

View File

@ -16,6 +16,7 @@
android:layout_alignParentTop="true"
android:layout_alignRight="@+id/btnAsync"
android:layout_marginTop="100dp"
android:onClick="onClick"
android:text="Generate Image Thread" />
<Button
@ -25,6 +26,7 @@
android:layout_below="@+id/btnThread"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
android:onClick="onClick"
android:text="Generate Image AsyncTask" />
</RelativeLayout>

View File

@ -2,7 +2,9 @@ package edu.uncc.itcs4180.hw4;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
public class MainActivity extends Activity {
@ -18,5 +20,13 @@ public class MainActivity extends Activity {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void onClick(View v) {
// One of our buttons has been clicked, let's start the activity and go!
if (v.getId() == R.id.btnAsync)
startActivity(new Intent(this, PhotoActivity.class));
else
startActivity(new Intent(this, PhotoThread.class));
}
}