[Java for Android App Development] hiphop12ism:
Hey people..

Just wanted to say that I am a complete noob in both android developing and java.

So just for the sake of experimenting, i was making a pretty lame Terms and Condition and Class and XML file, for my to be developed android app.

So according to me when the person hits Accept the app continues and when the user hits decline . It should finish.

I am having no errors. But in the emulator, when I click both Accept and Decline. Nothing happens. It is understandable for the Accept button as i havent started developing the next java class.

But when it hits the decline button, it is supposed to get closed.

Please help out the newbie here.

Thank You.

I am giving you the android manifest, and the First Java class for the terms and condition

The Java Class ( Terms.class)

_____________________________________________________________________________

package com.example.cplus;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Terms extends Activity {

[MENTION=439709]override[/MENTION]
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button accept, decline; // acept and decline button
accept=(Button) findViewById (R.id.button1);
decline=(Button) findViewById(R.id.button2);
accept.setOnClickListener(new View.OnClickListener() {

[MENTION=439709]override[/MENTION]
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent next= new Intent(Terms.this, MainActivity.class);
Terms.this.startActivity(next);
}
});
decline.setOnClickListener(new View.OnClickListener() {

[MENTION=439709]override[/MENTION]
public void onClick(View arg0) {
// TODO Auto-generated method stub
finish();
}
});
}

}

____________________________________________________________________________________

the android manifest

______________________________________________________________________________________

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="xda wont let me post outside links"
package="com.example.cplus"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="8" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".Terms"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.cplus.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.example.cplus.MAINACTIVITY" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>

</manifest>

______________________________________________________________________________________

the XML file (Main_activity.xml)

_____________________________________________________________________________________

<RelativeLayout xmlns:android="xda wont let me post outside links"
xmlns:tools="xda wont let me post outside links"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="75dp" >

<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content" >

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This Google Apps for Business (Online) Agreement (the “Agreement”) is entered into by and between Google Inc., a Delaware corporation, with offices at 1600 Amphitheatre Parkway, Mountain View, California 94043 (“Google”) and the entity agreeing to these terms (“Customer”). This Agreement is effective as of the date you click the “I Accept” button below or, if applicable, the date the Agreement is countersigned (the “Effective Date”). If you are accepting on behalf of your employer or another entity, you represent and warrant that: (i) you have full legal authority to bind your employer, or the applicable entity, to these terms and conditions; (ii) you have read and understand this Agreement; and (iii) you agree, on behalf of the party that you represent, to this Agreement. If you don&apos;t have the legal authority to bind your employer or the applicable entity, please do not click the “I Accept” button below (or, if applicable, do not sign this Agreement). This Agreement governs Customer&apos;s access to and use of the Services."
android:textAppearance="?android:attr/textAppearanceMedium" />
</ScrollView>
</LinearLayout>

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100"
android:layout_marginTop="350dp">
"

<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"

android:layout_weight="50"
android:text="Accept" />

<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"

android:layout_weight="50"
android:text="Decline" />
</LinearLayout>

</RelativeLayout>

again Thank you in advance :):)