<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"> xmlns:tools="http://schemas.android.com/tools" android:id="@+id/LinearLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" 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:c> <textview> android:id="@+id/textView1" android:layout_width="wrap_c/> <textview> android:id="@+id/textView2" android:layout_width="wrap_c/> <edittext> android:id="@+id/editText1" android:layout_width="279dp" android:layout_height="wrap_c/> <textview> android:id="@+id/textView3" android:layout_width="wrap_c/> <edittext> android:id="@+id/editText2" android:layout_width="279dp" android:layout_height="wrap_c> <requestfocus /> </edittext> <Button android:id="@+id/button2" android:layout_width="wrap_c/> <checkbox> android:id="@+id/checkBox1" android:layout_width="wrap_c/> <Button android:id="@+id/button3" android:layout_width="wrap_c/> <Button android:id="@+id/button1" android:layout_width="wrap_c/> </checkbox></textview></edittext></textview></textview></linearlayout>
package com.example.personaltracker; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final TextView PET = (TextView) findViewById(R.id.textView1); TextView Username = (TextView) findViewById(R.id.textView2); TextView Password = (TextView) findViewById(R.id.textView3); Button forgotpassword = (Button) findViewById(R.id.button3); final EditText username = (EditText) findViewById(R.id.editText1); final EditText password = (EditText) findViewById(R.id.editText2); Button register = (Button) findViewById(R.id.button1); CheckBox stayloggedin = (CheckBox) findViewById(R.id.checkBox1); Button login = (Button) findViewById(R.id.button2); login.setOnClickListener(new OnClickListener(){ @Override public void onClick(View arg0) { // TODO Auto-generated method stub Intent intent = new Intent(getBaseContext(),main_page.class); startActivity(intent); } }); register.setOnClickListener(new OnClickListener(){ @Override public void onClick(View arg0) { // TODO Auto-generated method stub Intent intent = new Intent(getBaseContext(),register.class); startActivity(intent); } }); forgotpassword.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub Intent intent = new Intent(getBaseContext(),forgot_password.class); startActivity(intent); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)