mirror of
https://github.com/bspeice/itcs4180
synced 2025-04-20 23:01:34 -04:00
Buttons now launch the correct activities
Only thing left to do is the photo activities themselves.
This commit is contained in:
parent
53b7016846
commit
ecb13bc4ed
@ -16,6 +16,7 @@
|
|||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_alignRight="@+id/btnAsync"
|
android:layout_alignRight="@+id/btnAsync"
|
||||||
android:layout_marginTop="100dp"
|
android:layout_marginTop="100dp"
|
||||||
|
android:onClick="onClick"
|
||||||
android:text="Generate Image Thread" />
|
android:text="Generate Image Thread" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@ -25,6 +26,7 @@
|
|||||||
android:layout_below="@+id/btnThread"
|
android:layout_below="@+id/btnThread"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="25dp"
|
android:layout_marginTop="25dp"
|
||||||
|
android:onClick="onClick"
|
||||||
android:text="Generate Image AsyncTask" />
|
android:text="Generate Image AsyncTask" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -2,7 +2,9 @@ package edu.uncc.itcs4180.hw4;
|
|||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
public class MainActivity extends Activity {
|
public class MainActivity extends Activity {
|
||||||
|
|
||||||
@ -18,5 +20,13 @@ public class MainActivity extends Activity {
|
|||||||
getMenuInflater().inflate(R.menu.main, menu);
|
getMenuInflater().inflate(R.menu.main, menu);
|
||||||
return true;
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user